Error Codes & Handling
TickAtlas uses standard HTTP status codes. All error responses include a JSON body with details.
Error Response Format
All errors return a consistent JSON structure:
{
"success": false,
"error": {
"code": "STRING_CODE",
"message": "Human-readable description"
}
} Error Codes Reference
Bad Request
The request was malformed or missing required parameters.
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Request is malformed or missing a required parameter"
}
} Fix: Check that all required parameters are included and correctly formatted. Empty symbol lists return NO_SYMBOLS; inverted time ranges return INVALID_TIME_RANGE.
Unauthorized
Missing or invalid API key.
{
"success": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API key"
}
} Fix: Verify your API key is correct and included in the X-API-Key header.
Forbidden
The API key does not have permission for this endpoint or IP is not whitelisted.
{
"success": false,
"error": {
"code": "PERMISSION_DENIED",
"message": "API key does not have access to this endpoint"
}
} Fix: Check key permissions in your dashboard. Verify IP whitelist if enabled.
Not Found
The requested resource does not exist.
{
"success": false,
"error": {
"code": "SYMBOL_NOT_FOUND",
"message": "Symbol INVALID not found"
}
} Fix: Verify the symbol name, indicator, or endpoint path is correct. Use /v1/symbols to list available symbols.
Rate Limited
Too many requests in the current time window.
{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 60 seconds",
"reset_in_seconds": 60
}
} Fix: Implement exponential backoff. Respect the Retry-After header. Consider upgrading your plan or caching responses.
Internal Server Error
An unexpected error occurred on our end.
{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
} Fix: Retry the request after a brief delay. If persistent, contact support with the request details.
Service Unavailable
The service is temporarily unavailable (maintenance or overload).
{
"success": false,
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "Service temporarily unavailable. Please try again later"
}
} Fix: Wait and retry. Check our status page for planned maintenance windows.
Error Handling Best Practices
Always check HTTP status codes
Don't assume success. Check that the status code is 200 before processing the response body.
Parse the error message
The message field provides specific details about what went wrong.
Implement retry logic
For 429 and 5xx errors, implement exponential backoff with jitter. Respect the Retry-After header.
Log errors for debugging
Log the full error response including timestamp, endpoint, and parameters for troubleshooting.
Example: Error Handling in Python
import requests
import time
def api_request(endpoint, params, max_retries=3):
url = f"https://tickatlas.com/v1/{endpoint}"
headers = {"X-API-Key": "YOUR_API_KEY"}
for attempt in range(max_retries):
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
return response.json()
elif response.status_code == 429:
retry_after = int(response.headers.get("Retry-After", 60))
print(f"Rate limited. Retrying in {retry_after}s...")
time.sleep(retry_after)
elif response.status_code >= 500:
wait = 2 ** attempt # Exponential backoff
print(f"Server error {response.status_code}. Retrying in {wait}s...")
time.sleep(wait)
else:
error = response.json()["error"]
raise Exception(f"API Error {error['code']}: {error['message']}")
raise Exception("Max retries exceeded") Related Pages
Complete Error Reference
For a comprehensive list of all error codes, including dashboard-specific errors and detailed troubleshooting guides, refer to our complete error documentation.
View Full Error Documentation