Getting started
Errors
The rare.market API error envelope, every error code with its HTTP status, example responses and which errors to retry.
The API uses HTTP status codes. Any response that is not 2xx has a JSON body with one error object.
The error envelope
{
"error": {
"code": "not_found",
"message": "Collection not found"
}
}Error responses carry no Cache-Control header. Do not cache them.
Codes
Examples
An unknown collection:
curl "https://rare.market/api/v1/collections/does-not-exist"{ "error": { "code": "not_found", "message": "Collection not found" } }A value outside the allowed list:
curl "https://rare.market/api/v1/events?collection=popkins&sort=bogus"{ "error": { "code": "bad_request", "message": "sort must be time or price" } }A cursor that was edited or truncated:
curl "https://rare.market/api/v1/collections?cursor=zzz"{ "error": { "code": "bad_request", "message": "Invalid cursor" } }A list that needs a filter. GET /orders needs collection or maker, and answers 404 without one:
{ "error": { "code": "not_found", "message": "Pass collection or maker" } }GET /offers works the same way and needs one of collection, item, maker or receiver.
Analytics endpoints (deals, holder quality, smart money, portfolio and others) answer 404 not_found while their data is not available, for example before the first analytics run for a collection. Treat that as "no data yet", not as a missing collection.
Gas sponsor codes
The gas sponsor routes (POST /sponsor, POST /sponsor/execute, GET /sponsor/status) use the same envelope with codes of their own. See Gas sponsoring.
Handling errors
- Branch on
error.code, not onmessage. - Retry
429and503(andsponsor_busy) with backoff. Do not retry other4xxcodes unchanged: fix the request first. - On
submit_failed, check whether the transaction landed before you send it again.
# Print the status code after the error body.
curl -sS -w "\n%{http_code}\n" "https://rare.market/api/v1/collections/does-not-exist"