
Search Adverse Events by Drug Name in FDA Adverse Event Reporting System
Source:R/get_fda_adverse_events.R
get_fda_adverse_events.Rd
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.
Source
FDA Adverse Event Reporting System (FAERS) via openFDA: https://open.fda.gov/apis/drug/event/
Value
A tibble with the following columns:
report_id
: Unique identifier for the adverse event reportdate_received
: Date FDA received the reportcountry
: Country where event occurredserious
: Is it serious? ("Yes", "No", or original API value / NA)adverse_reactions
: List of adverse reactions reported (separated by semicolons) or NApatient_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.
Examples
if (interactive()) {
get_fda_adverse_events("aspirin")
}