FDA recalls (drugs, devices, food)
Recall enforcement reports for drugs, medical devices or food (pick with type): recall number, event id, status, classification (Class I-III), product description and quantity, reason, code info, distribution pattern, voluntary or mandated, recalling firm with address, and initiation, classification, report and termination dates. Newest reports first by default. Filters accept a comma list (any of the values). Pass next_page back as page; null on the last page.
With count_by=<field> the response gives facet counts of the matching records by that field instead of the records: items of {term, count} (top count_limit). Text fields count whole values on their .exact index (e.g. count_by=openfda.manufacturer_name.exact); date fields give a time series grouped by count_interval (items of {period, count}). The other filters narrow what is counted.
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
type | drug | device | food | Which recalls (default drug). Example: food |
classification | 1 | 2 | 3 | Recall class (1 = most serious). Example: 1 |
status | ongoing | completed | terminated | pending | Recall status. |
firm | string | Recalling firm. |
product | string | Words in the product description. |
reason | string | Words in the reason for recall. |
state | string | Two-letter US state of the firm. |
country | string | Country of the firm. |
recall_number | string | Recall number (e.g. D-321-2016). |
event_id | string | Recall event id. |
voluntary_mandated | string | e.g. Voluntary: Firm initiated. |
distribution | string | Words in the distribution pattern (e.g. Nationwide). |
q | string | Free-text words; every word must appear somewhere in the record. |
from | string | Earliest date (YYYY-MM-DD) of the route's main date field. |
to | string | Latest date (YYYY-MM-DD). |
search | string | An openFDA query expression added to the filters with AND, for fields the named filters do not cover (e.g. openfda.route:"TOPICAL"). |
sort | report_date | recall_initiation_date | classification_date | Sort field (default: relevance, or the newest first where noted). |
order | desc | asc | Sort order (default desc). |
limit | integer | Results per page. |
page | integer | Page number (1-based). Pass next_page back as page; null on the last page. |
count_by | string | Count the matching records by this field (an openFDA field name, e.g. classification.exact, openfda.brand_name.exact, or a date field). |
count_limit | integer | Number of top terms for count_by (1-1000; default 100). |
count_interval | year | month | day | Grouping of a date count_by: year (default), month or day. |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/openfda/v1/recalls?type=food" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/openfda/v1/recalls",
params={"type": "food"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/openfda/v1/recalls");
url.searchParams.set("type", "food");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).