Public dataset · Health and life sciences
FDA Food Recalls and Adverse Events in BigQuery
Two openFDA tables: food recall enforcement reports (classification, reason, firm, distribution, status) and adverse event reports for foods, supplements and cosmetics (reactions, outcomes, products, consumer age and gender). 268,000 rows and 65 MiB in total, so every query bills the 10 MB minimum or close to it.
food_enforcement has one row per recall enforcement report: recall_number, classification, reason_for_recall, recalling_firm, product_description, distribution_pattern, status and dates for initiation, classification, report and termination. The column description defines the classes: Class I is for dangerous or defective products that predictably could cause serious health problems or death, Class II for products that might cause a temporary health problem, and Class III for products unlikely to cause an adverse reaction but that violate FDA labeling or manufacturing laws.
food_events has one row per adverse event report as published by openFDA: reactions and outcomes as comma-separated text, the product's brand name, industry code and name, the date FDA received the report (date_created), when the event started, and consumer age and gender. The column descriptions point to open.fda.gov for field definitions; products are generally limited to industry codes related to human food, nutritional supplements and cosmetics.
Both tables were modified on the day we measured, so the data is refreshed.
Tables and sizes
| Table | Rows | Size | Full scan | Layout |
|---|---|---|---|---|
food_eventsAdverse event reports: reactions, outcomes, product, industry, consumer age and gender. | 238,208 | 44.3 MiB | under $0.01 | None |
food_enforcementRecall enforcement reports: classification, reason, firm, product, distribution, status, dates. | 29,609 | 20.3 MiB | under $0.01 | None |
Example queries
Food recalls per year by classification
Two small columns: 510 KiB scanned, billed as 10 MB.
SELECT
EXTRACT(YEAR FROM recall_initiation_date) AS year,
classification,
COUNT(*) AS recalls
FROM `bigquery-public-data.fda_food.food_enforcement`
GROUP BY year, classification
ORDER BY year DESC, classification;Recent Class I recalls mentioning Listeria
Text search in reason_for_recall.
SELECT
recalling_firm,
reason_for_recall,
recall_initiation_date
FROM `bigquery-public-data.fda_food.food_enforcement`
WHERE classification = 'Class I'
AND LOWER(reason_for_recall) LIKE '%listeria%'
ORDER BY recall_initiation_date DESC
LIMIT 20;Most reported reactions in food adverse events
reactions is a comma-separated STRING, so it is split and unnested into one row per reaction.
SELECT
TRIM(reaction) AS reaction,
COUNT(*) AS reports
FROM `bigquery-public-data.fda_food.food_events`,
UNNEST(SPLIT(reactions, ',')) AS reaction
GROUP BY reaction
ORDER BY reports DESC
LIMIT 10;Adverse event reports by product industry
Groups food_events by products_industry_name.
SELECT
products_industry_name,
COUNT(*) AS reports
FROM `bigquery-public-data.fda_food.food_events`
GROUP BY products_industry_name
ORDER BY reports DESC
LIMIT 10;Querying it cheaply
- Both tables together are 65 MiB, so cost is never a concern here: most queries bill the 10 MB minimum per query.
- Because each query is billed at least 10 MB, many tiny queries cost more than one query that computes several aggregates at once. This matters only at very high query volumes, such as an app polling the table.
reactions,outcomesandproducts_brand_nameare delimited text. Use SPLIT with UNNEST to count individual values.
FAQ
How much does it cost to query the FDA food dataset?
Almost nothing. The two tables total 65 MiB, so the most a query can scan is 65 MiB, and most queries bill the 10 MB minimum. That is well inside the 1 TiB monthly free tier.
Is the fda_food dataset free?
Google pays for storing public datasets, so you never pay storage for them. You pay only for the bytes your queries scan, billed to your own project at the on-demand rate, and the first 1 TiB scanned each month is free. See BigQuery pricing.
What do Class I, II and III recalls mean?
The classification column description defines Class I as products that predictably could cause serious health problems or death. Class II covers products that might cause a temporary health problem, and Class III products unlikely to cause any adverse reaction but that break FDA labeling or manufacturing rules.
Related datasets
All public datasets · BigQuery cost queries · Pricing calculator
