Zabalist API · v1 · Reference
Errors
One envelope, a fixed set of machine-readable codes, and a request id on every response. Branch on error.code; everything else is for humans.
Format
The error envelope
Every 4xx and 5xx from /api/public/v1 — including the ones produced at the edge before your key is checked, and unknown paths — is JSON with a single error object.
error object
| Field | Type | Description |
|---|---|---|
code | string | Stable, machine-readable. Part of the v1 contract — safe to switch on. |
message | string | Human-readable. May be reworded at any time; do not parse. |
details | object | Validation, unsupported-parameter and deep-pagination errors: keyed by parameter, each value a list of reasons and workarounds. |
docs | string | Link to the API reference. |
request_id | string | req_ + 32 hex, identical to the X-Request-Id header. Quote it to support. |
hint | string | What to do next, when there is something useful to say. |
upgrade_url | string | quota_exceeded and plan_upgrade_required only: https://www.zabalist.com/developers/pricing |
{
"error": {
"code": "invalid_request",
"message": "`set_aside` is not supported on this endpoint yet.",
"details": {
"set_aside": [
"ESBD solicitations carry no set-aside/certification column in this database; …",
"Read certifications from /contractors/verify (`govcon.certifications`), or filter bids by class_code and cross-reference bidders."
]
},
"docs": "https://www.zabalist.com/developers/docs",
"request_id": "req_4f9c2a7e1b8d4e0f9a6c3b2d1e0f7a8b"
}
}Additive since 2026-10-22
request_id, hint and upgrade_url were added without changing any existing field. Clients written against the original code / message / details / docs shape keep working.
Reference
Every status and code
| Status | error.code | When | Retry? |
|---|---|---|---|
| 400 | invalid_request | A query parameter is missing, malformed or out of range; a parameter is not supported on this endpoint yet; `cursor` is malformed; the requested offset exceeds the 100,000 deep-pagination ceiling; a path id is not a UUID; or a watch request body is not valid JSON, has an unknown or invalid field, a filter its dataset does not accept, or a target URL Zabalist will not call. `error.details` names each offending parameter or field. | No. Fix the request. |
| 401 | missing_api_key | No `Authorization: Bearer …` or `X-API-Key` header was sent. | No. Add the key. |
| 401 | invalid_api_key | The key is malformed, unknown, or does not match. | No. Check the key. |
| 403 | key_revoked | The key was revoked. Permanent. | No. Issue a new key. |
| 403 | insufficient_scope | A team integration key was used outside its granted data scope. | Use a key issued for this operation. A plan upgrade cannot change this key’s scope. |
| 403 | key_disabled | The key is on a reversible hold (billing or abuse). | No. Resolve billing or contact support. |
| 403 | plan_upgrade_required | A live key on the Free plan called Contractor Verify, Contractor History or a watch endpoint, or sent an incremental-sync parameter (added_since, changed_since), all of which need a paid plan (Developer or above); or a paid account asked for more active watches than its plan includes. Carries error.upgrade_url. | No. Upgrade, or use a zbl_test_ key for sample responses. For the watch allowance, pausing or deleting a watch also works. |
| 404 | not_found | No record with that id (including records withheld for provenance), or no such endpoint under /api/public/v1. | No. |
| 429 | verify_spend_cap_reached | A Contractor Verify lookup would exceed the account’s explicit monthly overage cap. The default is $0. | Wait for the next Verify allowance or adjust the cap in the API dashboard. |
| 429 | rate_limited | Per-minute limit exceeded: your key’s plan RPM (20 for a zbl_test_ key), or (for keyless / not-yet-recognised keys) the per-IP budget of 30 requests/minute. Also returned by POST /watches/{id}/test when that watch has sent its hourly allowance of test deliveries. | Yes, after `Retry-After` seconds (60 for the per-minute limit; up to an hour for test deliveries). |
| 429 | quota_exceeded | The account’s monthly call quota — shared by every live key on the account — is used up. Resets 00:00 UTC on the 1st. Test keys are never blocked by it. | Not until the reset. `Retry-After` is the seconds until the 1st — can be weeks. Upgrade or stop. |
| 500 | upstream_error | The endpoint failed while serving the request. | Yes, with exponential backoff. |
| 503 | upstream_error | Authentication is temporarily unavailable, or (watch endpoints only) watch storage is. | Yes, after `Retry-After` seconds (5 for authentication, 60 for watches). |
Unknown query parameters are ignored, not rejected — a misspelled filter returns unfiltered results. Check names against the parameter tables or the OpenAPI document. Only GET is supported; other methods are not part of the contract.
429
Rate limit or quota?
Both are HTTP 429. rate_limited is per minute and per key: Retry-After is 60, and retrying after it succeeds. quota_exceeded is per UTC calendar month and per account (all of your live keys share it): Retry-After is the seconds until 00:00 UTC on the 1st, which can be weeks. A retry loop that sleeps on Retry-After without checking the code will hang a worker for a month — stop, alert a human, or upgrade.
Metered reads also share an account limit on work in progress. A 503 with a read-capacity message asks your client to reduce parallel requests and retry. Daily webhook protection counts each outbound attempt, its records, and the UTF-8 bytes in its body, including retries and test deliveries. A capacity hold preserves your watch position. Daily capacity resets at midnight UTC and carries no extra charge. Read data.resources from GET /usage for current limits and consumption. A held test returns its own Retry-After.
Headers
| Field | Type | Description |
|---|---|---|
X-Request-Id | string | Every response, success or error (req_ + 32 hex). Errors repeat it as error.request_id. Quote it when you contact support. |
RateLimit-Limit | integer | Requests per minute allowed for this key — the rate limit is per key, not per account. Your plan’s RPM once the edge has seen the key authenticate; 60 before that. Always 20 for a test key. |
RateLimit-Remaining | integer | Only on a 429 rate_limited for a known key, and always 0. Not sent on successful responses. |
RateLimit-Reset | integer | Only on a 429 rate_limited for a known key: seconds until the window frees up (60). |
X-Quota-Limit | integer | Monthly call quota of your account’s plan, shared by every live key on the account. Sent on every successful response, the 429 quota_exceeded, the 403 plan_upgrade_required, and 500s. |
X-Quota-Used | integer | Metered calls the whole account (every live key) had used this UTC month before this request. |
X-Quota-Remaining | integer | Calls the account has left this month, as of before this request. Never negative. |
X-Quota-Reset | string | ISO 8601 timestamp of the next quota reset: 00:00 UTC on the 1st. |
X-Api-Plan | string | free | developer | growth | scale. |
X-Api-Test-Mode | string | Only on responses to a test key (zbl_test_…), always true. The body is fixed sample data and meta.test_mode is true. |
Retry-After | integer | 429 rate_limited: 60. 429 quota_exceeded: seconds until 00:00 UTC on the 1st — can be weeks, never sleep on it. 503: 5. |
const BASE = 'https://www.zabalist.com/api/public/v1';
class QuotaExceededError extends Error {}
async function zabalist(path, params = {}, attempts = 5) {
const url = `${BASE}${path}?${new URLSearchParams(params)}`;
// A successful Contractor Verify lookup can incur an overage. Retry only these feeds.
const retryableRead = ['/projects', '/permits', '/bids', '/signals', '/coverage'].includes(path);
for (let attempt = 0; attempt < attempts; attempt++) {
const res = await fetch(url, {
headers: { 'X-API-Key': process.env.ZABALIST_API_KEY },
redirect: 'error', signal: AbortSignal.timeout(30000),
});
if (res.ok) return res.json();
const body = await res.json().catch(() => null);
const { code = 'http_error', message = 'HTTP ' + res.status,
request_id = res.headers.get('X-Request-Id'), upgrade_url } = body?.error ?? {};
// Monthly quota: Retry-After is the seconds until 00:00 UTC on the 1st —
// possibly weeks. Never sleep on it. Stop and tell a human.
if (code === 'quota_exceeded') {
throw new QuotaExceededError(
`${message} Resets ${res.headers.get('X-Quota-Reset')}. Upgrade: ${upgrade_url}`
);
}
// Per-minute rate limit (Retry-After: 60) and transient 5xx: back off, retry.
if (retryableRead && attempt + 1 < attempts && (code === 'rate_limited' || res.status >= 500)) {
const retryAfter = Number(res.headers.get('Retry-After'));
const seconds = retryAfter > 0 ? retryAfter : Math.min(2 ** attempt, 60);
if (seconds > 60) throw new Error(`Try again in ${seconds} seconds (request_id ${request_id})`);
await new Promise((r) => setTimeout(r, seconds * 1000 + Math.random() * 250));
continue;
}
throw new Error(`${code}: ${message} (request_id ${request_id})`);
}
throw new Error(`Gave up on ${path} after ${attempts} attempts`);
}
const { data } = await zabalist('/permits', { zip: '78745' });import os, random, time, requests
BASE = "https://www.zabalist.com/api/public/v1"
session = requests.Session()
session.headers["X-API-Key"] = os.environ["ZABALIST_API_KEY"]
class QuotaExceeded(Exception):
pass
def zabalist(path, attempts=5, **params):
retryable_read = path in ("/projects", "/permits", "/bids", "/signals", "/coverage")
for attempt in range(attempts):
res = session.get(f"{BASE}{path}", params=params, timeout=30, allow_redirects=False)
if 200 <= res.status_code < 300:
return res.json()
try:
body = res.json()
except ValueError:
body = None
error = body.get("error") if isinstance(body, dict) else None
error = error if isinstance(error, dict) else {}
code = error.get("code", "http_error")
message = error.get("message", f"HTTP {res.status_code}")
request_id = error.get("request_id") or res.headers.get("X-Request-Id")
# Monthly quota: Retry-After is the seconds until the 1st (can be
# weeks). Never sleep on it — stop and alert.
if code == "quota_exceeded":
raise QuotaExceeded(
f"{message} Resets {res.headers.get('X-Quota-Reset')}. "
f"Upgrade: {error.get('upgrade_url')}"
)
# Per-minute rate limit (Retry-After: 60) and transient 5xx: back off.
if retryable_read and attempt + 1 < attempts and (code == "rate_limited" or res.status_code >= 500):
retry_after = res.headers.get("Retry-After", "")
seconds = int(retry_after) if retry_after.isdecimal() else min(2 ** attempt, 60)
if seconds > 60:
raise RuntimeError(f"Try again in {seconds} seconds (request_id {request_id})")
time.sleep(seconds + random.random() / 4)
continue
raise RuntimeError(f"{code}: {message} (request_id {request_id})")
raise RuntimeError(f"gave up on {path} after {attempts} attempts")
permits = zabalist("/permits", zip="78745")["data"]400
Deep pagination
A page starting past offset 100,000 — sent as offset, or reached by following cursors — is refused with invalid_request. Narrow the query and page through each slice instead.
{
"error": {
"code": "invalid_request",
"message": "Pagination is capped at offset 100,000 (this request asked for 100,025).",
"details": {
"offset": [
"The maximum offset is 100000. Results past it cannot be paged to with this query.",
"Split the query into narrower slices (for example consecutive date windows such as issued_after/issued_before, or one county or ZIP at a time) and page through each slice."
],
"max_offset": 100000
},
"docs": "https://www.zabalist.com/developers/docs",
"request_id": "req_4f9c2a7e1b8d4e0f9a6c3b2d1e0f7a8b",
"hint": "Narrow the query with filters and page within each slice; offsets above 100000 are not served. See https://www.zabalist.com/developers/docs#pagination"
}
}Help
Getting help
Open a ticket from in-app support while signed in, with the request_id, the time, and the key prefix (zbl_live_ or zbl_test_ plus eight characters). Never send the full key.
Paths that are not the API
/api/v1/export and /api/v2/bulk are not product endpoints and do not return API errors. They are scraper traps: never call them — a request to either blocks the calling IP. The API lives only under /api/public/v1.