Errors
The error shape, the status codes, and when to retry.
Error model
Every error response uses the same JSON shape: a stable error code and a human-readable message. Branch on the HTTP status and the error code, never on the message text — messages may change.
{
"error": "bad_request",
"message": "Unknown sort field: foo"
}Status codes
The API uses a small, predictable set of status codes.
400 Bad Request
Validation failed — an unknown parameter, bad value, or malformed date/range. Fix the request before retrying.
client
401 Unauthorized
Missing, malformed, or revoked developer key. Do not retry; correct the X-API-Key header.
client
404 Not Found
Unknown route, network, asset, or wallet. The path or identifier does not resolve.
client
500 Server Error
Unexpected server-side failure.
server
Retries and backoff
Retry only on transient server-side errors. 4xx responses are caused by the request and will keep failing until you change it.
Retry policy
Retry 500 responses with exponential backoff and jitter, capped at a few attempts. Never retry 400, 401, or 404 — they fail the same way until you change the request.
Related pages
Start
Authentication
How to obtain a developer key and authenticate every request to the DexHunt API.
Start
API Conventions
Shared DexHunt API conventions for auth, decimal precision, coverage, pagination, validation, errors, and limits.
Start
Quickstart
Make the first DexHunt API requests with curl and inspect wallet, market, and timeseries responses.