Dev.to
7/21/2026

openFDA Adverse Event API: Paging Past 25,000 and Flattening
Short summary
The openFDA adverse event API hard-caps skip at 25,000, but the Link header's search_after cursor bypasses this limit entirely — measured at 31,968 records across 32 pages with zero duplicates. The critical trap: any non-zero skip silently degrades the cursor, so you must start with skip=0 or absent. Without an API key, limit maxes at 999; limit=1000 returns a misleading 403 API_KEY_MISSING error. The article includes production-ready JavaScript with retry logic, deduplication via safetyreportid+version+date composite keys, and a detailed error-code reference table.
- •Use the Link header's search_after cursor to page past the 25,000 skip cap — never combine non-zero skip with search_after
- •Without an API key, max limit is 999; limit=1000 returns 403 API_KEY_MISSING as a disguised page-size boundary
- •safetyreportid alone is not unique — deduplicate using safetyreportid + version + transmissiondate composite key
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



