TickQuote logoTickQuoteDocs

Docs search

Search the current language documentation index.

Docs/Docs·06

Error Code Reference

When a REST request or WebSocket operation fails, TickQuote returns a stable numeric code and a message string that your client can branch on.

Envelope
code/message/data
Machine code
code + message
Recovery
Explicit

Error Response Format

REST errors use the same code/message/data envelope as successful responses. WebSocket errors use type=error with code and message.

error.json
400/401/429/5xx
{
  "code": 42901,
  "message": "market_rate_limited",
  "data": null
}

Error Code Reference

Code
HTTP
Solution

0

success

200
request succeeded

Solution: Handle explicitly in the client and avoid blind retries.

40001

invalid_market_ticker

400
remove unsupported, provider, or slash tickers

Solution: Handle explicitly in the client and avoid blind retries.

40001

invalid_market_subscription

400
remove unsupported stream or operation values

Solution: Handle explicitly in the client and avoid blind retries.

40002

invalid_market_timeframe

400
use M1, M5, M15, M30, H1, H4, D1, W1, or MN1

Solution: Handle explicitly in the client and avoid blind retries.

40003

invalid_market_time_range

400
correct from, to, or limit

Solution: Handle explicitly in the client and avoid blind retries.

40101

unauthorized

401
provide a valid product API key

Solution: Rotate or refresh credentials before retry.

40301

market_access_denied

403
request market data entitlement

Solution: Handle explicitly in the client and avoid blind retries.

42901

market_rate_limited

429
back off and retry later

Solution: Retry with bounded backoff.

50301

market_service_unavailable

503
retry with bounded backoff

Solution: Retry with bounded backoff.

50302

market_data_not_ready

503
retry after the quote cache is ready

Solution: Retry with bounded backoff.

Error Handling Best Practices

Check code before reading data.

For REST, code 0 means success. Any non-zero code should be handled before your client reads data.

Use numeric codes for branching.

Messages are useful for logs, but retry, re-authentication, and entitlement handling should branch on code.

Implement exponential backoff for 429 and 5xx errors.

Wait increasingly longer between retry attempts.

Validate ticker and timeframe input.

Reject slash symbols and unsupported timeframes in your client before sending high-volume requests.

Error Handling Example

fetchQuotes.ts
Recovery flow
if (payload.code !== 0) {
  console.error(payload.code, payload.message)
  throw new Error(payload.message)
}

Need Help?

If you're encountering persistent errors or need help debugging your integration, review the authentication rules and dashboard token status first.