Skip to main content
Docs

API

Prepaid public REST — POST|GET /api/v1/sites/check is the priced unit. Coverage and usage are free. Keys are bk_live_. CORS stays off.

The public REST contract is a prepaid site check plus the two free reads a developer needs around it. There is no monthly API plan.

Start with the developer quickstart: load credit, mint a bk_live_ key at /settings/developer, call /api/v1/sites/check, and read the usage receipt.

Priced unit

POST|GET /api/v1/sites/check is the only metered route. The billable unit is a sourced result, not a transport call. Uncovered sites return HTTP 202 with answered: false and a receipt proving charged: false, reason: 'not_covered'.

Price: $0.10 USD per sourced check. Minimum load: $10 USD. A free account includes 10 site lookups a month, including headless use, so a $10 load is 110 checks in month one.

The envelope is { schemaVersion, checkId, answered, normalizedAddress, coverage, parcel, zoning, facts, citations, usage, generatedAt }. citations names the bylaw sections behind each fact (up to three per key). Read the text with GET /api/v1/citations/bylaw-sections?sectionIds=…. A null sectionId means no stored text for that section, not that the fact is uncited. Every priced response also stamps receipt headers. A 402 reports insufficient balance. Site checks do not support ETag/304 conditional requests.

Charge rules

GET and POST on sites/check both charge. Without a per-key spend cap (see below) the prepaid balance is the only bound.

CaseCharged
Sourced result (200)Yes, once, when the call settles
Not covered or unanswered (202)No
Validation (400), auth (401, 403), insufficient balance or key cap (402)No
Server error or timeout before a result existsNo
Same site, same account, within 24 hoursNo (usage.reason is deduplicated)
Retry with an Idempotency-Key that already settledNo (idempotent_replay)

After a timeout, retry with the same Idempotency-Key. Then compare usage.receiptId (equal to checkId) with GET /api/v1/usage/balance. GET /api/v1/credentials/self returns these rules as JSON.

Spend caps

A key has no cap until you set one. In Settings, or with PUT /api/developer/keys/{keyId}/spend-cap ({ "amountUsd": 25, "period": "day" }, a signed-in session only), a key can be limited per UTC day or month. The cap counts settled charges plus money held for calls in flight. When a call would cross it the response is 402 KEY_SPEND_CAP_REACHED with capMicroUsd, spentMicroUsd and resetsAt, even if the account still has balance. A repeat call that costs nothing (same site within 24 hours, idempotent replay) is never refused by a cap. GET /api/v1/credentials/self reports the key's cap and this window's spend, and GET /api/v1/usage/receipts lists what the key has spent.

Free reads

RouteAuthNotes
GET /api/v1/coverage/divisionsAnonymous or site:read keyFind the slug for a place by name (q) or point (lat, lng). Empty means not in the catalogue, not uncovered.
GET /api/v1/coverage/divisions/{slug}AnonymousCount-only coverage card. Take the slug from the discovery route above, for example ca-on-toronto.
GET /api/v1/citations/bylaw-sectionsSession, user JWT, or site:read keyStored bylaw text for section ids or a zone plus section numbers. Unresolved ids come back in missing.
GET /api/v1/usage/receiptsSession, user JWT, or usage:read keySettled charges, newest first. A key sees only its own. receiptId equals the checkId of the check that caused it.
GET /api/v1/credentials/selfSession, user JWT, or any valid keyYour scopes, which routes they allow, free or priced, rate limits, and the charge rules below.
GET /api/v1/usage/balanceSession, user JWT, or usage:read keyRemaining prepaid balance. A missing account is a zero balance, not a 404.
POST /api/v1/addresses/suggestOptional key (site:read)Free.
POST /api/v1/addresses/retrieveOptional key (site:read)Free.

What a key cannot do

  • sites/context stays session/JWT in M1 — not key-eligible, so callers cannot arbitrage a free context against a priced check.
  • sites/resolve is first-party only. It persists a feasibility_sites row. A key receives 403 FORBIDDEN.
  • feasibility/analyses* is first-party only. A key receives 403 CREDENTIAL_UNSUPPORTED. Use a product session or supported OAuth credential; loading credit cannot enable analysis access.
  • research/* is denylisted from the public OpenAPI artifact. Those handlers are admin-only.

Redaction

ownershipHint and rawCityData are never returned to a key, regardless of scope. If ownership is ever sold it is a separately-priced parcel:owner scope with its own consent review. See docs/api/public-api-boundary.md.

Authentication

Authorization: Bearer bk_live_… (or bk_test_…). Scopes: site:read, usage:read. CORS stays off — a key is a server-side credential and must not ship to a browser. Session cookies and Supabase user JWTs still work on v1; programmatic JWTs need Professional. Keys skip that subscription gate and debit prepaid credit.

Match auth errors on code: AUTH_REQUIRED and INVALID_API_KEY are 401; INSUFFICIENT_SCOPE is 403. Details live in docs/api/v1-auth.md.

OpenAPI

The machine-readable description is an OpenAPI 3.1 document:

https://buckybuild.com/openapi.json

The same document is served at /api/openapi, and both are advertised as service-desc in /.well-known/api-catalog. It is a curated subset of the internal surface — default-deny — covering /api/v1 (site check, coverage, usage, addresses) and /api/marketplace/v2.

Every operation carries a unique operationId, typed parameters, and a documented error schema.

Versioning, errors, and rate limits

  • Versioning is in the URL path (/api/v1, /api/marketplace/v2). There is no unversioned public surface. Within a version, changes are additive only. Retirement is signalled with Deprecation (RFC 9745) and Sunset (RFC 8594) response headers.
  • Errors return a consistent JSON envelope: error, code, category, status, retryable, supportId, requestId. Match on code, never on the message text.
  • Rate limits are reported as RateLimit and RateLimit-Policy alongside RateLimit-Limit / -Remaining / -Reset. A 429 carries Retry-After. The ledger is the spend bound — do not treat the per-lambda bucket as abuse control.

Use this today

  • HTTP — this page and the developer quickstart.
  • MCP — tools for agents. See MCP.
  • CLI — product and scripting workflows. See CLI.

Building an integration now? Start with the developer quickstart. Use MCP if you are wiring an AI agent, or the CLI for scripting.

Last updated on