GET STARTED

Errors

StarsAPI returns standard HTTP status codes plus a structured JSON error body with a machine-readable code, human-readable error message, and HTTP status. Build your error handling around the code field — error message strings may change over time.

Error shape

{
  "success": false,
  "error": "API key is required. Pass via X-Api-Key header or api_key parameter.",
  "code": "AUTH_MISSING_KEY",
  "status": 401
}

Error codes

HTTPCodeMeaning
400BAD_REQUESTGeneric malformed request (missing required field, wrong type)
400INVALID_PARAMA specific parameter failed validation (e.g. invalid sign name)
401AUTH_MISSING_KEYNo API key provided in header, query, or body
401AUTH_INVALID_KEYAPI key format invalid or key has been revoked
403AUTH_FORBIDDENKey valid but doesn't have permission for this endpoint
404NOT_FOUNDEndpoint or resource not found
429RATE_LIMITPer-minute, daily, monthly, or yearly limit exceeded
500SERVER_ERRORInternal error — retry with exponential backoff
503SERVICE_UNAVAILABLEBackend temporarily down (Swiss Ephemeris, AI provider, etc.)

Retries

Apply exponential backoff for these error codes:

  • 429 RATE_LIMIT — check the Retry-After response header and wait that many seconds
  • 500 SERVER_ERROR — retry up to 3 times with exponential backoff (1s, 2s, 4s)
  • 503 SERVICE_UNAVAILABLE — retry up to 3 times with exponential backoff

Do not retry these:

  • All 4xx codes except 429 (client errors are not transient)