openFDA Scraper: Drug Adverse Events, Device Recalls, and Food Safety Data
Extract FDA drug adverse events, device recalls, 510k clearances, and food enforcement actions from all openFDA endpoints using a single Python script. No API key required.
The actor referenced in this article. Pay only for results delivered.
The openFDA API exposes seven distinct endpoints covering drug adverse events, drug labeling, drug recalls, device 510k clearances, device adverse events, device recalls, and food enforcement actions. Each endpoint has its own URL scheme, field names, and pagination behavior.
Our openFDA Unified Scraper handles all seven through a single interface. You pick the endpoint, write a search query, and get back structured JSON.
Endpoints covered
| Endpoint | What it returns |
|---|---|
drug/event | Patient adverse event reports for drugs |
drug/label | FDA-approved prescribing information |
drug/enforcement | Drug recall actions and alerts |
device/510k | Device clearance decisions |
device/event | Medical device adverse events |
device/recall | Device recall actions |
food/enforcement | Food and supplement recall actions |
Python example
import requests
run = requests.post(
"https://api.apify.com/v2/acts/themineworks~openfda-unified-crawler/runs",
headers={"Authorization": f"Bearer {APIFY_TOKEN}"},
json={
"endpoint": "drug/event",
"search": "patient.drug.medicinalproduct:aspirin+AND+serious:1",
"maxResults": 100
}
)
run_id = run.json()["data"]["id"]
# Poll until finished
import time
while True:
status = requests.get(
f"https://api.apify.com/v2/actor-runs/{run_id}",
headers={"Authorization": f"Bearer {APIFY_TOKEN}"}
).json()["data"]["status"]
if status in ("SUCCEEDED", "FAILED"):
break
time.sleep(5)
# Fetch results
items = requests.get(
f"https://api.apify.com/v2/actor-runs/{run_id}/dataset/items",
headers={"Authorization": f"Bearer {APIFY_TOKEN}"}
).json()
for item in items:
print(item["endpoint"], item.get("patient", {}).get("patientdeath"))
Device 510k clearances
To pull medical device clearances from a specific applicant:
{
"endpoint": "device/510k",
"search": "applicant:Medtronic",
"maxResults": 50
}
Each result includes device name, applicant, decision date, product code, and the regulation number.
Food safety recalls
{
"endpoint": "food/enforcement",
"search": "reason_for_recall:undeclared+allergen",
"maxResults": 200
}
Returns recalling firm, product description, recall reason, classification (Class I/II/III), and states affected.
Search syntax
openFDA uses Lucene query syntax. Field names vary per endpoint. The search parameter is passed directly to the openFDA API, so the openFDA field reference is the canonical source for constructable queries.
Leave search empty to pull the most recent records across the entire endpoint.
Pricing
$0.002 per record. Runs with zero results are not charged.
The actor is available on Apify.
Explore the scraper referenced in this article: inputs, outputs, and pricing, then run it on Apify.
GitHub Repo Intelligence: Vet Any Dependency Before You Add It
Pull stars, forks, contributors, commit recency, latest release and full README for any public GitHub repo in one call. No token required, MCP-ready for agents doing dependency checks.
Bilibili Scraper: Video, Creator and Search Data in Python
Pull Bilibili videos by keyword, URL or creator ID: titles, view and like counts, duration, author stats. Plain HTTP, no cookies, no login required.
SEEK Jobs Scraper: Australian Job Listings in Python
How to pull SEEK.com.au job listings by keyword, location, work type and salary band in Python: title, company, salary range, apply link, no login or API key.