Skip to contents

Retrieves National Drug Code (NDC) information from the FDA NDC Directory that match a specific drug name using the RESTful API endpoint /drug/ndc.json?search=<drug_name>.

This includes details such as the NDC product code, brand name, generic name, labeler information, product type, dosage form, route of administration, marketing status, and active ingredients for pharmaceutical products marketed in the United States.

Usage

get_fda_ndc_directory(drug_name)

Source

FDA National Drug Code Directory via openFDA: https://open.fda.gov/apis/drug/ndc/

Arguments

drug_name

A character string representing the name of the drug (brand name or generic name).

Value

A tibble with the following columns:

  • ndc: National Drug Code (NDC) product identifier

  • brand: Brand or proprietary name of the drug product

  • generic: Generic (non-proprietary) name of the drug

  • ingredients: List of active ingredients with strengths

  • form: Pharmaceutical dosage form (e.g., TABLET, CAPSULE)

  • route: Route of administration (e.g., ORAL, INTRAVENOUS)

  • labeler: Name of the company that labels/markets the product

  • type: Type of drug product (e.g., HUMAN PRESCRIPTION DRUG)

  • status: Current marketing status (e.g., Prescription)

Details

This function sends a GET request to the FDA openFDA API. It supports caching via the memoise package to avoid redundant calls, and respects a rate limit between successive API requests.

The NDC Directory contains information on final marketed drugs submitted to FDA in SPL (Structured Product Labeling) electronic listing files. Assignment of an NDC number does not denote FDA approval of the product.

If the API request fails, returns no matches, or returns an error status code, the function returns NULL with an informative message.

Note

Requires an internet connection. The NDC Directory is updated daily by FDA.

See also

Examples

# \donttest{
  # This function requires an internet connection and downloads data from FDA
  get_fda_ndc_directory("aspirin")
#> # A tibble: 100 × 9
#>    ndc        brand         generic ingredients form  route labeler type  status
#>    <chr>      <chr>         <chr>   <chr>       <chr> <chr> <chr>   <chr> <chr> 
#>  1 68210-1013 NA            ACETAM… ACETAMINOP… TABL… NA    Spirit… DRUG… DRUG …
#>  2 11673-493  Chewable Low… Aspirin ASPIRIN (8… TABL… ORAL  TARGET… HUMA… OTC M…
#>  3 63941-105  Low Dose Che… ASPIRIN ASPIRIN (8… TABL… ORAL  VALU M… HUMA… OTC M…
#>  4 59779-945  ASPIRIN Low … Aspirin ASPIRIN (8… TABL… ORAL  CVS Ph… HUMA… OTC M…
#>  5 63868-228  Quality Choi… Aspiri… ASPIRIN (3… TABL… ORAL  Chain … HUMA… OTC M…
#>  6 68210-1015 NA            ASPIRIN ASPIRIN (8… TABL… NA    SPIRIT… DRUG… DRUG …
#>  7 0113-0467  good sense a… Aspirin ASPIRIN (8… TABL… ORAL  L. Per… HUMA… OTC M…
#>  8 56062-305  PUBLIX SUPER… ACETAM… ACETAMINOP… TABL… ORAL  PUBLIX… HUMA… ANDA  
#>  9 63868-229  Quality Choi… Aspiri… ANHYDROUS … TABL… ORAL  Chain … HUMA… OTC M…
#> 10 72036-018  ASPIRIN       ASPIRIN ASPIRIN (3… TABL… ORAL  HARRIS… HUMA… OTC M…
#> # ℹ 90 more rows
  get_fda_ndc_directory("ibuprofen")
#> # A tibble: 100 × 9
#>    ndc        brand         generic ingredients form  route labeler type  status
#>    <chr>      <chr>         <chr>   <chr>       <chr> <chr> <chr>   <chr> <chr> 
#>  1 85766-044  good sense d… Acetam… ACETAMINOP… TABL… ORAL  Sportp… HUMA… ANDA  
#>  2 59651-890  NA            IBUPRO… IBUPROFEN … CAPS… NA    Aurobi… DRUG… DRUG …
#>  3 21130-818  Signature Ca… Ibupro… IBUPROFEN … TABL… ORAL  Safeway HUMA… ANDA  
#>  4 50090-7053 good sense i… Ibupro… IBUPROFEN … TABL… ORAL  A-S Me… HUMA… ANDA  
#>  5 55910-647  dg health ib… Ibupro… IBUPROFEN … TABL… ORAL  Dolgen… HUMA… ANDA  
#>  6 62207-365  Ibuprofen     Ibupro… IBUPROFEN … TABL… ORAL  Granul… HUMA… ANDA  
#>  7 60760-929  Ibuprofen     Ibupro… IBUPROFEN … TABL… ORAL  ST. MA… HUMA… ANDA  
#>  8 63981-517  kirkland sig… Ibupro… IBUPROFEN … TABL… ORAL  Costco… HUMA… ANDA  
#>  9 76281-119  Childrens Ib… IBUPRO… IBUPROFEN … SUSP… ORAL  AptaPh… HUMA… ANDA  
#> 10 68998-012  Ibuprofen     Ibupro… IBUPROFEN … TABL… ORAL  MARC G… HUMA… ANDA  
#> # ℹ 90 more rows
# }