View source: R/get_fda_ndc_directory.R
| get_fda_ndc_directory | R Documentation |
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.
get_fda_ndc_directory(drug_name)
drug_name |
A character string representing the name of the drug (brand name or generic name). |
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.
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)
Requires an internet connection. The NDC Directory is updated daily by FDA.
FDA National Drug Code Directory via openFDA: https://open.fda.gov/apis/drug/ndc/
GET,
fromJSON,
as_tibble
# This function requires an internet connection and downloads data from FDA
get_fda_ndc_directory("aspirin")
get_fda_ndc_directory("ibuprofen")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.