
Search National Drug Code (NDC) Directory by Drug Name
Source:R/get_fda_ndc_directory.R
get_fda_ndc_directory.Rd
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.
Source
FDA National Drug Code Directory via openFDA: https://open.fda.gov/apis/drug/ndc/
Value
A tibble with the following columns:
ndc
: National Drug Code (NDC) product identifierbrand
: Brand or proprietary name of the drug productgeneric
: Generic (non-proprietary) name of the drugingredients
: List of active ingredients with strengthsform
: Pharmaceutical dosage form (e.g., TABLET, CAPSULE)route
: Route of administration (e.g., ORAL, INTRAVENOUS)labeler
: Name of the company that labels/markets the producttype
: 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.
Examples
if (interactive()) {
get_fda_ndc_directory("aspirin")
get_fda_ndc_directory("ibuprofen")
}