Skip to contents

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)

Source

FDA Drug Labeling Database via openFDA: https://open.fda.gov/apis/drug/label/

Arguments

drug_name

A character string representing the name of the drug.

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

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.

Note

Requires an internet connection.

See also

Examples

# \donttest{
  # This function requires an internet connection and downloads data from FDA
  get_fda_drug_labels("aspirin")
#> # A tibble: 100 × 8
#>    product_id            brand_name generic_name manufacturer product_type route
#>    <chr>                 <chr>      <chr>        <chr>        <chr>        <chr>
#>  1 008ee85b-5cac-45a6-a… Low Dose … ASPIRIN      P & L Devel… HUMAN OTC D… ORAL 
#>  2 39ea5b3c-510d-adb0-e… Rapidol A… ASPIRIN      Pharmadel L… HUMAN OTC D… ORAL 
#>  3 385229c2-9b6a-56ca-e… Aspirin L… ASPIRIN      ATLANTIC BI… HUMAN OTC D… ORAL 
#>  4 285f424d-b50c-c734-e… HEB Effer… ASPIRIN      H. E. BUTT … HUMAN OTC D… ORAL 
#>  5 249d869c-d17e-ebcb-e… Enteric C… ASPIRIN      DISCOUNT DR… HUMAN OTC D… ORAL 
#>  6 c8032d71-2485-4ab4-a… Aspirin E… ASPIRIN 81 … Lodaat LLC   HUMAN OTC D… ORAL 
#>  7 2969de2e-dde5-8daa-e… Extra Str… ACETAMINOPH… Lil' Drug S… HUMAN OTC D… ORAL 
#>  8 3e4cb995-be20-a159-e… Medique A… ACETAMINOPH… Unifirst Fi… HUMAN OTC D… ORAL 
#>  9 45b0b233-b206-0519-e… Aspirin 8… ASPIRIN      VALU MERCHA… HUMAN OTC D… ORAL 
#> 10 45b30e56-4555-140e-e… Aspirin    ASPIRIN      VALU MERCHA… HUMAN OTC D… ORAL 
#> # ℹ 90 more rows
#> # ℹ 2 more variables: indications <chr>, warnings <chr>
# }