CrawlClick API conventions, errors and rate limits
CrawlClick routes live under /v1 on two hosts, take and return JSON, refuse with an error sentence and a machine code, count money in integer micro-dollars, and close the connection after every response.
These conventions hold for every route on this site unless the route’s own page says otherwise. They were read from the CrawlClick API’s request handlers, not from a specification, so the exceptions are listed as well as the rules. The routes themselves, with their fields and refusals, are in the endpoint reference.
Which hosts does CrawlClick serve the API from?
There are two services, and each route belongs to one of them.
| Service | Base URL | What it serves |
|---|---|---|
| Control API | https://api.crawlclick.com |
The request-access form, the conversion postback, the Earn MCP connector and its OAuth routes, and the health checks. |
| Decision API | Issued with your partner key | The partner decision API: /v1/decide and /v1/decide/receipts. It runs as its own service and has no public hostname yet. |
Read the decision API’s base URL from configuration, for example CRAWLCLICK_DECISION_URL, rather than writing it into code. The publisher edge is not an API you call: it is a Worker CrawlClick runs in front of your hostname, described in How the edge works.
Why does every path start with /v1?
Every callable route is under /v1. The exceptions are the health checks (/healthz and /readyz) and the OAuth discovery documents under /.well-known/, whose paths are fixed by RFC 8414 and RFC 9728. There is no version header and no content negotiation on version. The console also calls routes under /v1, but those accept only a console session minted by a magic link, so no outside program can authenticate to them and they are not documented as an API.
What format do requests and responses use?
Requests and responses are JSON with Content-Type: application/json. Two exceptions: the OAuth token endpoint of the Earn connector takes a form-encoded body, as OAuth 2.0 specifies, and the connector’s authorize page is HTML for a person’s browser.
The services speak HTTP/1.1 and send Connection: close on every response, so each request uses a new connection. They read a request body by its Content-Length header and do not decode a chunked request body; send a buffered body, which every HTTP client in the samples on this site does by default. Responses from the decision API and from the conversion and connector routes carry Cache-Control: no-store.
What does an error response look like?
Most refusals have this shape:
{"error": "that conversion key is not valid", "code": "invalid_key"}
error is a sentence for a person and may change wording. code is the stable, machine-readable value: branch on code and the HTTP status, never on the sentence. The errors reference lists every code an outside caller can receive.
Some responses do not follow that shape, and a client should handle them:
- The request-access route refuses with only
{"error": "…"}. - A body over the size limit gets
413with only{"error": "…"}; headers that are incomplete or too large get431. - The control API’s per-address rate limit answers
429with{"error": "rate limit exceeded"}and nocode. - A control API that is over its connection capacity answers
503with an empty body andRetry-After: 1. - The conversion postback reports an unknown click as
404with{"status": "unknown_click"}. - The Earn connector’s OAuth endpoints use the OAuth 2.0 shape,
{"error": "invalid_grant", "error_description": "…"}, and its MCP endpoint answers in JSON-RPC 2.0.
Some outcomes that are not failures arrive with a success status and their own field, such as {"filled": false} from /v1/decide or {"recorded": false, "code": "budget_exhausted"} from a receipt. Read the route’s page for those.
How are money amounts represented?
Money is always an integer number of micro-dollars: 1 USD is 1,000,000 micros, so one cent is 10,000. Fields that carry money end in _micros, for example price_micros on a decision. All amounts are US dollars; CrawlClick operates in USD only. Use 64-bit integers, and do not convert to floating point before you have finished adding amounts up. No price, floor or payout figure is documented here; they are on www.crawlclick.com/pricing/.
How large can a request body be?
| Service | Largest body | Over the limit |
|---|---|---|
| Control API | 262,144 bytes | 413 Content Too Large, {"error": "request body exceeds 262144 bytes"} |
| Decision API | 65,536 bytes | 413 Content Too Large, {"error": "body too large"} |
The limit is checked against the declared Content-Length before the body is read. Individual fields have their own limits, which are smaller: for example, /v1/decide truncates query to 500 characters and reads at most 30 topics.
How are requests rate-limited?
Every limit is a token bucket kept in memory by each server process. A bucket starts full, so a short burst is allowed, and refills continuously at the per-minute rate. Because the count is per process, the limit you observe is approximate rather than an exact global count.
- Decision API, per partner. Each partner account has a requests-per-minute rate set by CrawlClick. Decisions and receipts are counted in separate buckets. Over the rate you get
429with coderate_limited. - Control API, per client address. Requests that arrive through the public ingress are limited per client IP address before any credential is looked up. The code’s default is 600 requests a minute per address, and the deployed value can differ. Over the rate you get
429with{"error": "rate limit exceeded"}. - Earn connector, per connection.
find_offersallows 30 calls per connection per minute. Over that, the tool returns a result withisError: truerather than an HTTP error.
No route sets X-RateLimit-Limit, X-RateLimit-Remaining or X-RateLimit-Reset, and a 429 carries no Retry-After. On a 429, back off with jitter, starting at about one second.
Which routes can a browser call?
Only two groups of routes answer a CORS preflight:
/v1/access-requestsanswersOPTIONSonly for the CrawlClick website’s exact origin, allowingPOSTwithContent-Type. Any other origin gets403.- The Earn connector’s routes (
/v1/app/mcp,/v1/app/oauth/…and the/.well-known/oauth-…documents) sendAccess-Control-Allow-Origin: *and allowAuthorization,Content-Type,Mcp-Session-IdandMCP-Protocol-Version, so a browser-based MCP client can connect.
The conversion postback and the decision API send no CORS headers. They take secret keys, and a key in browser code is a key anyone can read: call them from your server.
How do I check that the API is up?
Both services answer GET /healthz with 200 {"status": "alive"}. It shows the process is answering and depends on nothing else. On the control API, GET /readyz also checks its database and object storage; the result is cached for up to five seconds, and a failed dependency gives 503 with "status": "not_ready" and the failing dependency set to false. On the decision API, /readyz returns 200 {"status": "ready"}.
GET/readyzLive
Readiness of the control API and its storage.
- Host
- https://api.crawlclick.com
- Authentication
- None.
- Source
- api-crawlclick-com/crates/crawlclick/src/main.rs
Responses
200 · Ready.
{"status": "ready", "postgres": true, "object_store": true}503 · A dependency is unavailable. Each flag says which.
{"status": "not_ready", "postgres": false, "object_store": true}What do timestamps and ids look like?
Timestamps on the decision API are integer Unix seconds in UTC, for example expires_at on a decision. Offers returned by the Earn connector carry expires_at as an ISO 8601 UTC string such as 2026-12-04T18:00:00Z. Durations, such as expires_in on an OAuth token, are whole seconds.
Treat every id and token as an opaque string and send it back byte for byte. Their prefixes tell you what they are:
| Prefix or shape | What it is |
|---|---|
ccp_… |
A partner key for the decision API. |
ccx1.… |
A decision_id from /v1/decide. |
dec:… |
The event_id of a recorded receipt. |
cck_… |
An advertiser’s conversion key. |
| 32 hexadecimal characters | A cc_click click id. |
ccl1.…, ccm1.…, ccr1.… |
An Earn connector client id, access token and refresh token. |