View source: R/get_fda_drug_labels.R
| get_fda_drug_labels | R Documentation |
Retrieves drug label information from the FDA Drug Labeling Database
that match a specific drug name using the RESTful API endpoint
/drug/label.json?search=<drug_name>.
This includes details such as the product ID, brand name, generic name, indications and usage, dosage and administration, warnings, drug interactions, and other prescribing information from FDA-approved drug labels.
get_fda_drug_labels(drug_name)
drug_name |
A character string representing the name of the drug. |
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.
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:
product_id: Unique identifier for the product
brand_name: Brand or trade name of the product
generic_name: Generic name of the active ingredient
manufacturer: Name of the manufacturer
product_type: Type of drug product
route: Route of administration
indications: Approved indications for use
warnings: Important warnings and precautions
Requires an internet connection.
FDA Drug Labeling Database via openFDA: https://open.fda.gov/apis/drug/label/
GET,
fromJSON,
as_tibble
# This function requires an internet connection and downloads data from FDA
get_fda_drug_labels("aspirin")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.