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

if (interactive()) {
  get_fda_ndc_directory("aspirin")
  get_fda_ndc_directory("ibuprofen")
}