Skip to contents

Retrieves adverse event reports from the FDA Adverse Event Reporting System (FAERS) that match a specific drug name using the RESTful API endpoint /drug/event.json?search=<drug_name>.

This includes details such as the safety report ID, receive date, serious status, patient information, drug details, and adverse reactions for each reported adverse event related to pharmaceutical products.

Usage

get_fda_adverse_events(drug_name)

Source

FDA Adverse Event Reporting System (FAERS) via openFDA: https://open.fda.gov/apis/drug/event/

Arguments

drug_name

A character string representing the name of the drug.

Value

A tibble with the following columns:

  • report_id: Unique identifier for the adverse event report

  • date_received: Date FDA received the report

  • country: Country where event occurred

  • serious: Is it serious? ("Yes", "No", or original API value / NA)

  • adverse_reactions: List of adverse reactions reported (separated by semicolons) or NA

  • patient_sex: Patient sex ("Male", "Female", "Unknown", original API value, or NA)

  • patient_age: Patient age at onset (as returned by API) or NA

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{
  # Esta función requiere conexión a internet y descarga datos de la FDA
  get_fda_adverse_events("aspirin")
#> # A tibble: 100 × 7
#>    report_id date_received country serious adverse_reactions         patient_sex
#>    <chr>     <date>        <chr>   <chr>   <chr>                     <chr>      
#>  1 10003304  2014-03-12    US      No      Drug hypersensitivity     Female     
#>  2 10003310  2014-03-12    US      No      Back pain                 Female     
#>  3 10003321  2014-03-12    JP      Yes     Adenoviral haemorrhagic … Male       
#>  4 10003349  2014-03-12    US      Yes     Cerebrovascular accident… Female     
#>  5 10003432  2014-03-12    US      Yes     Oedema peripheral; Fluid… Female     
#>  6 10003582  2014-03-12    US      No      Hypertension; Dehydratio… Male       
#>  7 10003595  2014-03-12    US      Yes     Transfusion               Male       
#>  8 10003632  2014-03-12    US      Yes     Influenza; Pneumonia      Male       
#>  9 10003701  2014-03-12    US      Yes     Chronic obstructive pulm… Male       
#> 10 10003713  2014-03-12    US      No      Rash; Dyspnoea            Female     
#> # ℹ 90 more rows
#> # ℹ 1 more variable: patient_age <chr>
# }