Rate limits and errors
Every error code the API returns, its HTTP status, whether it was charged and what to do next. Includes the throughput limit and how to retry.
BuddyGeo reports problems in two places at once: the HTTP status of the response, and an error object in the body that names the problem and the next step. Failed requests are never charged.
The error object
Every error response carries at least request_id, status and error:
{
"request_id": "req_7c1e40b93fa2",
"status": 429,
"error": {
"code": "rate_limited",
"message": "Too many requests: the plan allows 5 per second across all keys.",
"next_step": "Wait 1 second and retry. Throttled requests are not charged.",
"retry_after_s": 1
}
}/v1/reverse and /v1/search return their full envelope when a request fails validation: the same error object, next to outcome: "invalid", credits_charged: 0 and result: null. The JSON view of the playground shows every outcome in that envelope form.
| Field | Description |
|---|---|
error.code | Stable machine-readable code. Branch on this, not on message |
error.message | What happened, in plain language |
error.next_step | What you can do about it, in one sentence. Safe to show to an operator |
error.retry_after_s | Seconds to wait before a retry makes sense. Present on 429 and 503 |
error.field | The offending parameter, for validation errors |
Keep the request_id of a failed request. It finds the request under Request logs, where the credit treatment is explained, and it is the first thing support will ask for.
Error codes
| HTTP status | error.code | When | Example error.next_step |
|---|---|---|---|
| 400 | invalid_coordinates | lat or lon is missing, not a number, or out of range. | Send lat between -90 and 90 and lon between -180 and 180 as decimal degrees, latitude first. |
| 400 | invalid_query | q is empty or longer than 200 characters, or detail or country has an unsupported value. | Send a place name or address in q, for example q=CN Tower. |
| 400 | invalid_request | The body of POST /v1/batch is not valid JSON, has no rows, exceeds the maximum batch size, or has an address that is not text or longer than 200 characters. | Send {"rows":[{"id":"a1","lat":43.6426,"lon":-79.3871}]}. |
| 401 | missing_api_key | The request has no X-API-Key header. | Send your key in the X-API-Key header. You can create one under API keys in the dashboard. |
| 401 | invalid_api_key | The key is not recognized, for example because characters are missing. | Check the key for missing characters, or create a new one under API keys in the dashboard. |
| 401 | revoked_api_key | The key was revoked, or it was rotated and its overlap period has ended. | Switch to an active key, or create a replacement under API keys in the dashboard. |
| 402 | quota_exhausted | The monthly credit allowance (and any prepaid pack balance) is used up, and metered overages are off. | Purchase a prepaid pack, enable opt-in metered overages on a paid plan, upgrade under Billing, or wait until the allowance renews. |
| 402 | overage_cap_reached | Opt-in metered overages are enabled, and the workspace has reached its configured monthly USD spend cap. | Raise your monthly overage spend cap or upgrade your plan under /dashboard/billing. |
| 402 | ai_quota_exhausted | Your workspace has consumed its monthly managed AI actions allowance (and any prepaid AI pack balance) with metered overages off. | Purchase a prepaid AI pack, enable opt-in metered overages on a paid plan, or upgrade under /dashboard/billing. |
| 404 | not_found | The path or the batch job does not exist. | Use /v1/reverse, /v1/search, /v1/batch, /v1/usage or the Nominatim-compatible /reverse and /search. |
| 405 | method_not_allowed | The endpoint exists but does not accept this HTTP method. | Send the request again with GET. |
| 429 | rate_limited | The workspace sent more requests per second than its plan allows, across all of its keys. | Wait 1 second and retry. Throttled requests are not charged. |
| 503 | upstream_unavailable | The geocoder behind the API is temporarily unavailable. | Check the status page and retry in about 30 seconds. Failed requests are not charged. |
| 503 | ai_provider_unavailable | The managed LLM gateway timed out or tripped its circuit breaker. | Retry shortly or call /v1/search without ai_repair. No credits or AI actions were deducted. |
| 503 | ai_disabled | AI endpoints are disabled on this BuddyGeo instance. | Use standard deterministic /v1/search or /v1/reverse endpoints. |
| 504 | upstream_timeout | The geocoder did not answer in time. | Retry the request in a few seconds. Timed-out requests are not charged. |
200 responses can still carry result: null: a lookup that finds nothing has the outcome no_match, is free, and is not an error. See Reverse geocoding.
Rate limits
Each plan has a sustained throughput limit in requests per second. It is counted per workspace over a sliding one-second window and shared by all keys of that workspace, so adding keys does not add throughput.
| Plan | Price | Monthly credits | Monthly AI actions | Throughput | Overage / Pack rates |
|---|---|---|---|---|---|
| Free | Free | 2,500 | 250 | 1 request / second | $1.00 / 1,000 spatial · $5.00 / 1,000 AI (prepaid packs, never expire) |
| Developer | $19 / month | 100,000 | 5,000 | 5 requests / second | $0.35 / 1,000 spatial · $3.00 / 1,000 AI (opt-in metered, hard cap default) |
| Growth | $29 / month | 1,000,000 | 15,000 | 10 requests / second | $0.10 / 1,000 spatial · $2.00 / 1,000 AI (opt-in metered, hard cap default) |
A request over the limit is rejected with 429 rate_limited before any lookup runs. It costs nothing, and error.retry_after_s says how long to wait. The API contract also sends that value as the Retry-After response header.
Retrying
429 rate_limited: waitretry_after_sseconds, then retry. If you send bursts, queue requests on your side at the plan's rate rather than retrying in a tight loop.503 upstream_unavailable: the geocoder is down or restarting. Wait aboutretry_after_sseconds and check the status page.504 upstream_timeout: retry after a few seconds, with exponential backoff if it repeats.400and401: do not retry unchanged. Fix the request or the key first.402 quota_exhausted: retrying will not help until the allowance renews or the plan changes. See Credits and billing.
async function reverse(lat, lon, attempt = 0) {
const params = new URLSearchParams({ lat, lon });
const response = await fetch(`https://api.buddygeo.com/v1/reverse?${params}`, {
headers: { "X-API-Key": process.env.BUDDYGEO_API_KEY },
});
const data = await response.json();
const retryable = [429, 503, 504].includes(response.status);
if (retryable && attempt < 3) {
const seconds = data.error?.retry_after_s ?? 2 ** attempt;
await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
return reverse(lat, lon, attempt + 1);
}
if (data.error) {
throw new Error(`${data.error.code} (${data.request_id}): ${data.error.next_step}`);
}
return data.result; // null when nothing is mapped near the point
}Single-request retry and idempotency semantics
Understanding how BuddyGeo treats retries versus repeated lookups prevents unexpected credit spend:
- Retries after
429,503, or504are free: Because failed, rate-limited, and timed-out requests always charge0credits, retrying after receiving a429,503, or504response never double-charges your workspace. - Repeated successful single lookups are each billed 1 credit:
GET /v1/reverse,GET /v1/search,/reverse, and/searchare stateless lookups and do not deduplicate repeated identical coordinates or addresses across separate HTTP requests. If your client intentionally requestslat=43.6426&lon=-79.3871twice—or retries a request whose200response was lost on the client network after BuddyGeo already completed it—each completed HTTP200match is charged 1 credit. Cache known coordinates/addresses on your side if your application queries the same locations repeatedly. - Batch submissions are strictly idempotent via
Idempotency-Key: ForPOST /v1/batches, supply a workspace-scopedIdempotency-Keyheader. Retrying the same key with the identical payload replays the existing job (200,idempotent_replay: true) without creating a second job or double-reserving credits.
For large one-off workloads, a bulk job is simpler than pacing single requests yourself: the job runs at your plan's rate and you download the result.
Quota
When the monthly allowance is used up, lookups are rejected with 402 quota_exhausted until the allowance renews or the plan is upgraded. Rejected requests are not charged. The dashboard warns before that happens, at 80% of the allowance, and you can configure a near-limit alert under Alerts.
See each error without causing it
Rate limited (429)
What a throttled request looks like, without sending a burst.
Quota exhausted (402)
What a request looks like once the allowance is used up.
Service timeout (504)
What a request looks like when the geocoder does not answer in time.
Invalid input (400)
Latitude 91.5 is out of range and is rejected before any lookup.
Failed requests in your logs
Filter the request log by outcome and open a request for its explanation.
Service status
Whether the API or the geocoder is degraded right now.
Related guides
Credits and billing
One successful lookup or matched spreadsheet row costs one credit. Everything else is free. How allowances, bulk reservations and plan changes work.
Authentication
Send your key in the X-API-Key header. Create one key per environment, rotate with an overlap and revoke what you no longer use.
Troubleshooting
Fix the problems that come up most often - 401 after a rotation, 429 bursts, swapped coordinates, no match over water - and collect what support needs.
Reverse geocoding
GET /v1/reverse turns a latitude and longitude into the nearest mapped address, with its components, its own coordinate and an explanation of the match.
Python (geopy) & QGIS setup
Fix public Nominatim 403 blocks in Python geopy in three lines, geocode pandas DataFrames via /v1/batch, and speed up QGIS workflows.
Credits and billing
One successful lookup or matched spreadsheet row costs one credit. Everything else is free. How allowances, bulk reservations and plan changes work.