Skip to content

Errors

Every error from the QuantConomy API returns the same JSON shape with the appropriate HTTP status. Errors are machine-readable: branch on the HTTP status and the stable error.code rather than parsing error.message, which is human-facing and may change.

{
"success": false,
"error": {
"message": "Human-readable description of what went wrong.",
"code": "MACHINE_READABLE_CODE",
"details": [{ "field": "limit", "message": "Expected number" }]
},
"statusCode": 400,
"timestamp": "2026-06-05T12:00:00.000Z"
}
FieldTypeNotes
successfalseAlways false on errors. Successful responses use { "success": true, "data": ... }.
error.messagestringHuman-readable summary. Do not match on this.
error.codestringStable machine-readable code (see table below). Branch on this.
error.detailsarray?Present only on field-level validation failures.
statusCodenumberMirrors the HTTP status.
timestampstringISO 8601 timestamp of when the error was generated.
Statuserror.codeCauseHow to fix
200Success. Body is { "success": true, "data": ... }.
400BAD_REQUESTMalformed request or schema validation failure (bad/missing query params, invalid body). Carries details[] on field errors. Also returned to the demo key when you request limit greater than 3 or use a pagination param (cursor/offset/page).Fix the offending parameters listed in details[]. With the demo key, request at most 3 results and don’t paginate — or use your own key.
401UNAUTHORIZEDMissing, malformed, invalid, expired, or revoked API key. Every endpoint except GET / and GET /health requires a key.Send a valid Authorization: Bearer mtk_... header (the demo key mtk_demo works). See Authentication.
402INSUFFICIENT_CREDITSYour credit balance is below the request’s cost. Nothing was charged or executed. With the demo key, this means the shared ~100/hour demo budget is exhausted.Wait for your monthly grant, buy a credit pack, or upgrade. On the demo key, wait for the hourly refill or use your own key.
403FORBIDDENYour plan lacks access to this resource (e.g. SEC data requires Starter or higher; real-time signals require real-time SSE access).Upgrade your plan to a tier that includes the feature.
404NOT_FOUNDThe resource does not exist, or the route/path is unknown.Check the id and the URL path against the API reference.
429RATE_LIMIT_EXCEEDEDYou exceeded your plan’s request rate (or, on the demo key, the shared demo rate bucket). No credits charged.Back off and retry. Honour Retry-After. See Rate limits.
500INTERNAL_ERRORUnexpected server-side error.Retry with backoff. If it persists, check the status page.

A 400 from schema validation includes a details array. Each entry pinpoints one offending field:

FieldTypeMeaning
fieldstringThe path of the parameter or body field that failed (e.g. limit, packageId).
messagestringWhat was expected for that field.
{
"success": false,
"error": {
"message": "Validation failed",
"code": "BAD_REQUEST",
"details": [
{ "field": "limit", "message": "Expected number to be less than or equal to 100" },
{ "field": "cursor", "message": "Expected string" }
]
},
"statusCode": 400,
"timestamp": "2026-06-05T12:00:00.000Z"
}

401 — missing or invalid key

{
"success": false,
"error": {
"message": "Unauthorized",
"code": "UNAUTHORIZED"
},
"statusCode": 401,
"timestamp": "2026-06-05T12:00:00.000Z"
}

402 — out of credits

{
"success": false,
"error": {
"message": "Insufficient credits",
"code": "INSUFFICIENT_CREDITS"
},
"statusCode": 402,
"timestamp": "2026-06-05T12:00:00.000Z"
}

402 — demo budget exhausted (the shared demo key’s hourly credit bucket is empty; it refills hourly)

{
"success": false,
"error": {
"message": "Demo credit budget exhausted — it refills hourly. Sign up for your own credits at https://app.quantconomy.com.",
"code": "INSUFFICIENT_CREDITS"
},
"statusCode": 402,
"timestamp": "2026-06-05T12:00:00.000Z"
}

400 — demo result cap exceeded (the demo key is limited to 3 results and cannot paginate)

{
"success": false,
"error": {
"message": "The demo key is limited to 3 results per request. Sign up for your own key at https://app.quantconomy.com to request more.",
"code": "BAD_REQUEST"
},
"statusCode": 400,
"timestamp": "2026-06-05T12:00:00.000Z"
}

403 — plan does not include SEC data

{
"success": false,
"error": {
"message": "Forbidden",
"code": "FORBIDDEN"
},
"statusCode": 403,
"timestamp": "2026-06-05T12:00:00.000Z"
}

404 — unknown resource

{
"success": false,
"error": {
"message": "Not found",
"code": "NOT_FOUND"
},
"statusCode": 404,
"timestamp": "2026-06-05T12:00:00.000Z"
}

429 — rate limited (see Rate limits for the accompanying headers)

{
"success": false,
"error": {
"message": "Rate limit exceeded. Please try again later.",
"code": "RATE_LIMIT_EXCEEDED"
},
"statusCode": 429,
"timestamp": "2026-06-05T12:00:00.000Z"
}