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.005 per record. Runs with zero results are not charged.
The actor is available on Apify.
Explore the scraper referenced in this article — see inputs, outputs, and pricing, then run it on Apify.
Airbnb Scraper: Listing Prices, Ratings, and Availability Without the API
Airbnb has no public listings API. Here's how to pull nightly price, rating, superhost status and coordinates from Airbnb search results using Python.
Maps Leads: Verified Email Extraction from Google Maps Business Listings
How to pull B2B leads from Google Maps with MX-verified emails, past the official API's 120-result cap, and pay only for contactable businesses.
Realtor.com Scraper: Property and Agent Data Without the MLS Paywall
Scrape Realtor.com listings in Python — price, beds, baths, county, and the listing agent + brokerage office on every record. No login, no API key.