Errors

When a request cannot be completed, the API responds with a non-2xx HTTP status code and a JSON body describing what went wrong. Every error body shares the same envelope, so you can handle failures with a single code path.

Error response shape

json
HTTP/1.1 404 Not Found { "status": "fail", "type": "COIN_NOT_FOUND", "message": "Coin not found" }
FieldTypeDescription
statusStringfail for 4xx client errors, error for 5xx server errors.
type / codeStringA stable, machine-readable identifier for the error. Branch on this rather than on message. See the note below on which field is present.
messageStringA human-readable explanation. This text may change over time, so do not match on it programmatically.
`type` vs `code`: Errors raised by the API itself (a coin that does not exist, an invalid parameter, a bad cursor) carry a type field. Errors raised by the gateway in front of the API (authentication, plan access, and rate limiting) carry a code field instead. Both always include status and message. If you read the identifier defensively — for example body.type || body.code — you will handle either family.

HTTP status codes

StatusMeaning
200Success.
401Unauthorized — the API key is missing or invalid.
403Forbidden — your plan does not include this endpoint.
404Not found — the requested resource (or route) does not exist.
410Gone — the endpoint has been removed.
422Unprocessable entity — a parameter failed validation.
429Too many requests — you have hit a rate limit.
5xxA server-side or upstream error. status is error. Retry with backoff.

API errors

These are returned by the API and carry a type field.

TypeStatusWhen it happens
VALIDATION_ERROR422A query or path parameter failed validation. The message names the offending parameter.
COIN_NOT_FOUND404No coin matches the requested UUID.
EXCHANGE_NOT_FOUND404No exchange matches the requested UUID.
MARKET_NOT_FOUND404No market matches the requested UUID.
PRICE_NOT_FOUND404No price is available for the requested resource.
BLOCKCHAIN_NOT_FOUND404The blockchain is not recognised. See /v2/blockchains for valid values.
GAINS_AND_LOSSES_NOT_FOUND404No gains-and-losses data is available for the request.
INVALID_TIMEPERIOD_REFERENCE_COMBINATION404No change could be calculated for this reference currency in this time period (the reference currency likely did not exist yet).
TOO_MANY_REQUESTS429A per-endpoint fair-use limit was hit — for example the daily quota on deep historical OHLCV requests. Distinct from the gateway's RATE_LIMIT_EXCEEDED. Slow down and retry.
REFERENCE_UNAVAILABLE422The referenceCurrencyUuid is not a valid reference currency. See the reference currencies endpoint.
TAG_UNAVAILABLE422The requested tag is not available.
PAGE_UNAVAILABLE422The requested page slug is not available.
INVALID_CURSOR422The cursor is malformed or could not be decoded. Start pagination from the beginning.
CURSOR_MISMATCH422The cursor was created with a different orderBy/orderDirection. Match the original parameters or start over.
PAGINATION_CONFLICT422Both cursor and offset were supplied. Use only one pagination method per request.
OFFSET_TOO_LARGE422The offset exceeds the maximum of 5000. Use cursor-based pagination for deeper results.
UNKNOWN_ERROR500An unexpected server error. status is error. Retry with backoff and contact support if it persists.

For more on the pagination errors, see the pagination guide.

Access & rate-limit errors

These are returned by the gateway and carry a code field.

CodeStatusWhen it happens
UNAUTHORIZED401The API key is missing or invalid. See authentication.
FORBIDDEN403Your subscription plan does not include this endpoint. Upgrade your plan.
RATE_LIMIT_EXCEEDED429You have reached a rate limit for your plan. See rate limits.
NOT_FOUND404The requested route does not exist. Check the path against the documentation.
ENDPOINT_NOT_SUPPORTED410The endpoint has been removed. Use the latest documentation.
BAD_GATEWAY502The upstream service was unavailable. Retry with backoff.
GATEWAY_TIMEOUT504The upstream service timed out. Retry with backoff.

Rate-limit exceeded

When you exceed a rate limit, the gateway returns 429 with a RATE_LIMIT_EXCEEDED body:

json
HTTP/1.1 429 Too Many Requests { "status": "fail", "code": "RATE_LIMIT_EXCEEDED", "message": "You've reached the API request limit. Please upgrade your subscription plan: https://coinranking.com/api/pricing" }

If the request was made without an API key, the message instead points you to create a free key. Every response — including this one — carries rate-limit headers, and 429 responses add a retry-after header telling you how many seconds to wait before retrying. See the rate limits page for the full list of headers.

Handling errors

Branch on the identifier, not the message. The type/code values are stable; message text is not, and may change without notice.
Retry 429 and 5xx responses with exponential backoff. Honour the retry-after header on 429 responses. Do not retry 4xx errors other than 429 — they will keep failing until you change the request.