Get a key, copy a sample request, then jump straight to each agency’s parameter and field reference. Every adapter follows the same shape: auth, filter, paginate, export.
Register once at api.data.gov/signup and that one key unlocks FEC, NASA, NPS, FDA, USDA, and Census endpoints. The email you provide is just for rate-limit accounting — there is no approval step and the key arrives instantly. USAJOBS, FRED, BLS, and EIA each require their own free key (see each agency’s developer page).
Treat the key like a password: do not commit it to source control. In this project, store it under DATA_GOV_API_KEY in Cloud → Secrets so server functions can read it from process.env.
Most api.data.gov-fronted endpoints accept the key as the api_key query parameter. A few (NPS, some NOAA endpoints) prefer it as an X-Api-Key header. Both work identically for rate-limit accounting.
curl -G 'https://api.open.fec.gov/v1/candidates/' \ -d api_key=$DATA_GOV_API_KEY \ -d q=harris \ -d sort=name
curl 'https://developer.nps.gov/api/v1/parks?stateCode=CA' \ -H "X-Api-Key: $DATA_GOV_API_KEY"
api.data.gov returns X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset on every response. Default quota is 1,000 requests/hour per key. A 429 response means you’ve hit the cap; back off until the reset timestamp.
const res = await fetch(url)
const limit = res.headers.get('x-ratelimit-limit')
const remaining = res.headers.get('x-ratelimit-remaining')
const reset = res.headers.get('x-ratelimit-reset')
if (res.status === 429) throw new Error(`Rate limited; resets at ${reset}`)Pass UI state directly into query parameters and keep the request function pure.
curl -G 'https://api.open.fec.gov/v1/schedules/schedule_a/' \ -d api_key=$DATA_GOV_API_KEY \ -d contributor_state=CA \ -d min_amount=2500 \ -d sort=-contribution_receipt_amount \ -d per_page=100 -d page=1
Paginate, normalize, then convert to a CSV blob in the browser. Stable column keys keep the export aligned with what users see on screen.
const csv = [headers.join(','), ...rows.map(r => headers.map(h => esc(r[h])).join(','))].join('\n')
const url = URL.createObjectURL(new Blob([csv], { type: 'text/csv' }))USAJOBS needs a User-Agent header plus an Authorization-Key header. FRED takes api_key as a query param. BLS is technically open but works more reliably with a key. Build a tiny auth adapter rather than assuming one universal rule.
SEC EDGAR and NWS both require a descriptive User-Agent identifying your app and contact email — requests without it are rejected.
Jump to each agency’s official parameter reference, or open the live explorer to test queries against your key in this repo.
| API | Key | Docs | Parameters & fields | Explorer |
|---|---|---|---|---|
Federal Election Commission FEC | api.data.gov | Overview | Reference | Open |
NASA Open APIs NASA | api.data.gov | Overview | Reference | Open |
National Park Service NPS | api.data.gov | Overview | Reference | Open |
USGS Earthquakes USGS | Public | Overview | Reference | Open |
openFDA FDA | Public | Overview | Reference | Open |
Federal Register FEDREG | Public | Overview | Reference | Open |
National Weather Service NWS | Public | Overview | Reference | Open |
U.S. Treasury Fiscal Data TREAS | Public | Overview | Reference | Open |
SEC EDGAR SEC | Public | Overview | Reference | Open |
Public Holidays (Nager.Date) HOLIDAYS | Public | Overview | Reference | Open |
curl -G 'https://api.open.fec.gov/v1/candidates/' \ -d api_key=$API_DATA_GOV_KEY \ -d q=harris -d sort=name -d per_page=20
curl -G 'https://api.nasa.gov/planetary/apod' \ -d api_key=$API_DATA_GOV_KEY \ -d date=2024-07-04
curl -G 'https://developer.nps.gov/api/v1/parks' \ -H "X-Api-Key: $API_DATA_GOV_KEY" \ -d stateCode=CA -d limit=10
curl -G 'https://earthquake.usgs.gov/fdsnws/event/1/query' \ -d format=geojson \ -d starttime=2024-01-01 \ -d minmagnitude=5
curl -G 'https://api.fda.gov/drug/event.json' \ -d search='patient.reaction.reactionmeddrapt:"nausea"' \ -d limit=5
curl -G 'https://www.federalregister.gov/api/v1/documents.json' \ -d 'conditions[term]=climate' \ -d per_page=20
curl 'https://api.weather.gov/alerts/active?area=FL' \ -H 'User-Agent: (your-app, you@example.com)'
curl -G 'https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny' \ -d sort=-record_date -d 'page[size]=10'
curl 'https://data.sec.gov/submissions/CIK0000320193.json' \ -H 'User-Agent: (your-app, you@example.com)'
curl 'https://date.nager.at/api/v3/PublicHolidays/2025/US'