Errors
Failed requests return an HTTP error status and a JSON body with a stable error.code.
{
"success": false,
"error": {
"code": "invalid_legs",
"message": "legs[1].expiry must be a date (YYYY-MM-DD)"
}
}Branch on error.code. The message is written for people and may change.
Error codes
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_request, invalid_json | The body or a parameter is wrong. The message says which. |
| 400 | invalid_legs | A leg is missing a field, or has an invalid type, action, strike, expiry, price or IV. |
| 400 | invalid_symbol | symbol isn't a ticker. |
| 400 | invalid_period, invalid_limit | Site trends: period must be day, week or month; limit is out of range. |
| 401 | api_key_required | This endpoint needs a key. |
| 401 | invalid_api_key | The key doesn't exist or was revoked. |
| 403 | email_not_verified, payment_required | Finish setting up your account: confirm your email and add a card. |
| 403 | ip_not_allowed, user_agent_not_allowed | The key is restricted to other IPs or user agents. |
| 404 | not_found | No such endpoint, or no options for that symbol. |
| 404 | invalid_expiry, option_not_found | No options expire on that date, or no option at that strike and expiry. |
| 405 | method_not_allowed | Wrong HTTP method; the Allow header lists the right ones. |
| 429 | rate_limited | Too many requests this second or minute. Wait Retry-After seconds. |
| 429 | quota_exceeded | Free plan: the daily or monthly quota is used up. |
| 429 | overage_cap_reached | Paid plan: your monthly overage spending cap is reached. |
| 500 | internal_error | Something broke on our side. Retry, and contact us if it continues. |
| 503 | data_unavailable, calculation_failed | Market data or a calculation wasn't available. Retry shortly, or pass the prices yourself. |
Retrying
- 429: wait for the
Retry-Afterheader, in seconds. - 500 and 503: retry with exponential backoff (for example 1, 2, then 4 seconds).
- 4xx otherwise: don't retry; fix the request.