Error Handling

The API uses standard HTTP status codes and returns all responses in a consistent JSON envelope with success, data, error, and meta fields.

ENVELOPE

Response Format

All API responses — both success and error — follow this standard envelope:

Success Response

{
  "success": true,
  "data": { ... },
  "error": null,
  "meta": {
    "requestId": "req_a1b2c3",
    "timestamp": "2026-03-17T10:30:00Z",
    "version": "v1"
  }
}

Error Response

{
  "success": false,
  "data": null,
  "error": {
    "code": "INVALID_PARAMETER",
    "message": "The \"code\" parameter is required.",
    "details": "Provide a valid contract code (e.g., AAPL_NASDAQ). Use GET /v1/market/exchanges/{symbol} to find available exchanges."
  },
  "meta": {
    "requestId": "req_x9y8z7w6",
    "timestamp": "2026-03-17T10:30:00Z",
    "version": "v1"
  }
}

SCHEMA

Envelope Fields

FieldTypeDescription
successbooleanWhether the request was successful
dataobject | array | nullThe response payload (varies by endpoint)
errorApiError | nullError details when success is false
metaApiMetaRequest metadata (requestId, timestamp, version)

ApiError Object

FieldTypeDescription
codestringMachine-readable error code (e.g., "INVALID_PARAMETER")
messagestringHuman-readable error message
detailsstring | nullAdditional context about the error

ApiMeta Object

FieldTypeDescription
requestIdstringUnique request identifier for debugging
timestampdatetimeServer timestamp of the response
versionstringAPI version (e.g., "v1")

STATUS CODES

HTTP Status Codes

CodeNameDescriptionHow to Fix
400Bad RequestThe request body or parameters are invalid.Check required fields and data types match the schema.
401UnauthorizedMissing or invalid API key / JWT token.Include a valid X-Api-Key header or JWT Bearer token.
403ForbiddenThe API key lacks permission for this action.Use an active API key with sufficient permissions.
404Not FoundThe requested resource does not exist.Verify the symbol, keyId, or endpoint path.
429Too Many RequestsRate limit exceeded.Wait and retry. Check your usage limits via GET /v1/account/usage.
500Internal Server ErrorAn unexpected error occurred on the server.Retry the request. Contact support if it persists.

RATE LIMITS

Rate Limiting

The API enforces per-account rate limits to ensure fair usage and platform stability. Rate limit information is included in every response via HTTP headers. Check your limits via GET /v1/account/usage.

Standard Endpoints

120 requests per minute. Applies to most endpoints. Check usage via GET /v1/account/usage.

Market Data Endpoints

300 requests per minute. Applies to market data and options endpoints for higher throughput.

Rate Limit Headers

HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the current window
X-RateLimit-RemainingRemaining requests in the current window
X-RateLimit-ResetUnix timestamp when the rate limit resets

HANDLING

When Rate Limited

When you exceed the rate limit, the API returns a 429 Too Many Requests response:

{
  "success": false,
  "data": null,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Please wait before retrying.",
    "details": "You have exceeded 120 requests per minute."
  },
  "meta": { "requestId": "req_x9y8z7", "version": "v1" }
}

Recommended strategy: Implement exponential backoff with jitter. Read the X-RateLimit-Reset header to know exactly when your limit resets.

Need Help?

Our developer support team is here to help you integrate successfully.

Contact SupportView Quickstart