FDA adverse event counts

GET https://api.api.sh/openfda/v1/adverse-events/stats
1 credit / call government & registries try it in the playground →

Counts of drug adverse event reports grouped by a field: the top reactions, drugs, brands, generics, substances, manufacturers, indications, pharmacologic classes, routes, outcomes, sexes, age groups, countries, reporter types or seriousness for the reports matching the filters, or a timeline by day (by=date) or year (by=year). Takes every filter of /openfda/v1/adverse-events.

Every response includes credits_used: the credits this call cost.

Parameters

nametypedescription
by reaction | drug | brand | generic | substance | manufacturer | indication | pharm_class | outcome | sex | age_group | country | reporter | serious | route | year | date Field to count by. Example: reaction
generic string Generic name. Example: metformin
brand string Brand name.
drug string Drug name as reported.
reaction string Reaction term.
serious true | false Serious reports only.
sex male | female | unknown Patient sex.
country string Two-letter country.
from string Earliest receive date (YYYY-MM-DD).
to string Latest receive date (YYYY-MM-DD).
search string An openFDA query expression added with AND.
limit integer Number of top terms (up to 1000; for date, the latest days).

Every endpoint also takes fresh, raw, fields (see lean responses and caching).

Example

curl "https://api.api.sh/openfda/v1/adverse-events/stats?by=reaction" \
  -H "x-api-key: $APISH_KEY"

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).

The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.