Errors

ChartInspect API status codes, common error fields, and safe retry behavior.

REST failures return JSON with an error message. Most also include success: false and may add structured context such as validChains, availableMetrics, currentTier, sourceStatus, or upgradeUrl. Do not require every endpoint to return an identical error object.

#Status Codes

StatusMeaningRetry?
400A parameter is malformed, out of range, or unsupportedFix the request
401The API key is missing, invalid, or expiredFix or rotate credentials
403The key is valid but lacks the required tier, permission, field, endpoint, or IP grantChange access policy
404The endpoint, metric, resolution, or requested data window does not existChange the request
409A chart exists but has no certified public data contractUse a catalog-listed dataset
429An hourly or daily quota was exceededRetry after reset
500An unexpected server error occurredRetry with backoff
502A required upstream data source failed or returned invalid dataRetry with backoff

#Example

json
{
  "success": false,
  "error": "Resolution \"min10\" not available for metric \"example\".",
  "requestedResolution": "min10",
  "availableResolutions": ["day1"]
}

#Handling Errors

javascript
const response = await fetch(url, { headers: { "x-api-key": apiKey } });
const contentType = response.headers.get("content-type") || "";
const body = contentType.includes("application/json")
  ? await response.json()
  : await response.text();

if (response.status === 429 || response.status >;= 500) {
  // Retry later with exponential backoff and jitter.
} else if (!response.ok) {
  // Log the status and structured error, then fix credentials or parameters.
}

Use exact IDs returned by discovery, validate date strings as YYYY-MM-DD, and check the resolution matrix before requesting sub-day data.

Was this page helpful?