Learn R Programming

MedxR (version 0.1.0)

get_fda_drug_labels: Search Drug Labels by Drug Name in FDA Drug Labeling Database

Description

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.

Usage

get_fda_drug_labels(drug_name)

Value

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

Arguments

drug_name

A character string representing the name of the drug.

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.

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

See Also

Examples

Run this code
# \donttest{
  # This function requires an internet connection and downloads data from FDA
  get_fda_drug_labels("aspirin")
# }

Run the code above in your browser using DataLab