get_fda_adverse_events: Search Adverse Events by Drug Name in FDA Adverse Event...

View source: R/get_fda_adverse_events.R

get_fda_adverse_eventsR Documentation

Search Adverse Events by Drug Name in FDA Adverse Event Reporting System

Description

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)

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.

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

Note

Requires an internet connection.

Source

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

See Also

GET, fromJSON, as_tibble

Examples


  # Esta función requiere conexión a internet y descarga datos de la FDA
  get_fda_adverse_events("aspirin")



MedxR documentation built on Jan. 14, 2026, 5:08 p.m.