Skip to contents

This function scrapes the openFDA API for food, dietary supplement, and cosmetic adverse event reports

Usage

adverse_events(
  api_key,
  consumer.gender = NULL,
  consumer.age = NULL,
  consumer.age_unit = NULL,
  date_created = NULL,
  date_started = NULL,
  limit = NULL,
  outcomes = NULL,
  products.name_brand = NULL,
  products.industry_name = NULL,
  products.industry_code = NULL,
  reactions = NULL,
  report_number = NULL,
  search_mode = NULL
)

Arguments

api_key

Your free api key from openFDA website

consumer.gender

A way the FDA classifies a date

consumer.age

Description of product

consumer.age_unit

Date for which recall was initiated

date_created

The company recalling the product

date_started

The date the FDA issued the enforcement report for the product recall

limit

The number of rows to return for that query

outcomes

This gives the user flexibility to search for exact matches of inputs or any combination of inputs

products.name_brand

The status of the recall

products.industry_name

The date the recall was terminated

products.industry_code

The date the recall was terminated

reactions

The date the recall was terminated

report_number

The date the recall was terminated

search_mode

The way to search for the data

Value

A data frame with the returned results of the users query to the API

Examples

if (FALSE) { # \dontrun{
adverse_events(api_key = api_key, outcomes = "Hospitalization", date_created = "2020")
adverse_events(api_key = api_key, products.industry_name = "Food", date_started = "2021")
adverse_events(api_key = api_key, products.name_brand = "Lucky Charms")
} # }