Skip to content

Errors

All errors return a consistent JSON structure:

json
{
  "status": 400,
  "error": "Bad Request",
  "message": "Human-readable description of what went wrong",
  "timestamp": "2026-04-04T14:30:00Z"
}

Error codes

HTTPErrorMeaningResolution
400Bad RequestInvalid parameters or malformed requestCheck request body and parameters
400INVALID_ADDRESSAddress format not recognized for chainVerify address format matches chain (e.g., 0x... for EVM, T... for TRON)
400CHAIN_NOT_SUPPORTEDChain not in supported listSee supported chains
401UnauthorizedMissing or invalid API keyCheck X-API-Key header
402Payment RequiredMonthly credit limit reachedPurchase credits or upgrade plan
402UPGRADE_REQUIREDFeature requires higher tierUpgrade at app.cryptachain.com/billing
404Not FoundResource does not existVerify the endpoint path and resource ID
429Too Many RequestsRate limit exceededSee rate limits — back off and retry
500Internal Server ErrorUnexpected server errorRetry after a few seconds; contact support if persistent
503Service UnavailableData source temporarily unavailableRetry after Retry-After seconds (header included)
504Gateway TimeoutQuery took too longTry a narrower date range or smaller page size

Handling errors

typescript
try {
  const res = await fetch(url, { headers: { 'X-API-Key': key } });

  if (!res.ok) {
    const err = await res.json();
    switch (res.status) {
      case 429:
        // Rate limited — retry with backoff
        const retryAfter = parseInt(res.headers.get('Retry-After') || '1');
        await sleep(retryAfter * 1000);
        return retry();
      case 402:
        // Credit limit — notify user
        console.error('Credit limit reached:', err.message);
        break;
      default:
        console.error(`API error ${res.status}:`, err.message);
    }
  }
} catch (e) {
  // Network error — retry with backoff
}

CryptaChain API — built by CryptaCount Luxembourg S.a r.l.