Skip to Content
BuddyGeoDocs

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.

FieldDescription
error.codeStable machine-readable code. Branch on this, not on message
error.messageWhat happened, in plain language
error.next_stepWhat you can do about it, in one sentence. Safe to show to an operator
error.retry_after_sSeconds to wait before a retry makes sense. Present on 429 and 503
error.fieldThe 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 statuserror.codeWhenExample error.next_step
400invalid_coordinateslat 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.
400invalid_queryq 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.
400invalid_requestThe 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}]}.
401missing_api_keyThe 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.
401invalid_api_keyThe 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.
401revoked_api_keyThe 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.
402quota_exhaustedThe 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.
402overage_cap_reachedOpt-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.
402ai_quota_exhaustedYour 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.
404not_foundThe path or the batch job does not exist.Use /v1/reverse, /v1/search, /v1/batch, /v1/usage or the Nominatim-compatible /reverse and /search.
405method_not_allowedThe endpoint exists but does not accept this HTTP method.Send the request again with GET.
429rate_limitedThe 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.
503upstream_unavailableThe geocoder behind the API is temporarily unavailable.Check the status page and retry in about 30 seconds. Failed requests are not charged.
503ai_provider_unavailableThe 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.
503ai_disabledAI endpoints are disabled on this BuddyGeo instance.Use standard deterministic /v1/search or /v1/reverse endpoints.
504upstream_timeoutThe 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.

PlanPriceMonthly creditsMonthly AI actionsThroughputOverage / Pack rates
FreeFree2,5002501 request / second$1.00 / 1,000 spatial · $5.00 / 1,000 AI (prepaid packs, never expire)
Developer$19 / month100,0005,0005 requests / second$0.35 / 1,000 spatial · $3.00 / 1,000 AI (opt-in metered, hard cap default)
Growth$29 / month1,000,00015,00010 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: wait retry_after_s seconds, 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 about retry_after_s seconds and check the status page.
  • 504 upstream_timeout: retry after a few seconds, with exponential backoff if it repeats.
  • 400 and 401: 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, or 504 are free: Because failed, rate-limited, and timed-out requests always charge 0 credits, retrying after receiving a 429, 503, or 504 response never double-charges your workspace.
  • Repeated successful single lookups are each billed 1 credit: GET /v1/reverse, GET /v1/search, /reverse, and /search are stateless lookups and do not deduplicate repeated identical coordinates or addresses across separate HTTP requests. If your client intentionally requests lat=43.6426&lon=-79.3871 twice—or retries a request whose 200 response was lost on the client network after BuddyGeo already completed it—each completed HTTP 200 match 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: For POST /v1/batches, supply a workspace-scoped Idempotency-Key header. 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

On this page