Developer API

Put recycling answers in your app

The Earth911 API turns a plain-language question — “where do I recycle batteries near me?” — into structured materials and nearby drop-off locations. One authenticated GET request, JSON back.

Quickstart

1. Create a key in the developer portal (it’s shown once — save it).

2. Call the search endpoint with your key in the X-API-Key header:

curl "https://earth911-web-production.up.railway.app/api/v2/search?q=recycle+batteries+near+me&lat=45.52&lng=-122.68" \
  -H "X-API-Key: key_your_key_here"

3. You get structured materials + nearby locations back as JSON (see below).

Authentication

Send your key in the X-API-Key header to get your key’s rate limits. Requests without a key still work but share the anonymous web quota (a few searches per day) — fine for trying the API, not for an app. Keys are scoped (read:locations, read:materials) and rate-limited per key. Never embed a production key in client-side code you ship to users — proxy through your backend.

X-API-Key: key_xxxxxxxxxxxxxxxxxxxxxxxx

Rate limits & tiers

Limits are enforced per key. The free tier allows 60 requests/minute and 10,000/day. Exceeding a window returns 429 Too Many Requests with a Retry-After header. Higher tiers are coming with paid plans — keys and current limits live in your dashboard’s Developer page.

Errors

400Missing or malformed query parameter.
401Invalid X-API-Key (keyless requests fall back to the anonymous quota instead).
403Key lacks the required scope.
429Rate limit hit — back off and retry after Retry-After.
5xxTransient server error — retry with backoff.

Errors return JSON: { "detail": "…" }.