AstroAsk Docs

Errors

Every error code the API returns, with status, meaning and the fix.

Errors always use real HTTP status codes and a structured body:

{ "success": false, "error": "INVALID_DATE", "message": "Date must be ISO 8601 format: 1990-01-15T10:30:00" }

error is a stable machine-readable code — branch on it, not on message (messages may be reworded; codes will not).

Authentication — 401 / 403

CodeStatusMeaning
MISSING_API_KEY401No key in X-API-Key or Authorization: Bearer
INVALID_API_KEY401Key unknown or revoked
KEY_EXPIRED403Non-trial key past its expiry date
IP_NOT_ALLOWED403Key is IP-restricted and this request came from elsewhere

Limits — 402 / 429

CodeStatusMeaning
TRIAL_EXPIRED402Trial cap (5,000 requests) or 14-day window hit — hard stop
QUOTA_EXCEEDED429Monthly allowance exhausted
RATE_LIMITED429Per-second ceiling hit — retry after Retry-After seconds

Request validation — 400

CodeStatusMeaning
MISSING_FIELDS400A required field (date, lat, lng, …) is absent
INVALID_DATE400Date is not ISO 8601 (1990-01-15T10:30:00)
INVALID_LATITUDE400Latitude outside −90…90
INVALID_LONGITUDE400Longitude outside −180…180
INVALID_ID400Malformed resource id (e.g. city id on /geo/city)
INVALID_BATCH400/batch body malformed or requests empty
BATCH_TOO_LARGE400More than 50 items in one batch
NESTED_BATCH400A batch item targeting /batch

Routing & availability — 404

CodeStatusMeaning
NOT_FOUND404No such endpoint or resource
NOT_AVAILABLE404Endpoint exists but is not offered on your channel (e.g. /batch is direct-API only, not available via marketplace resellers)

Server — 422 / 500

CodeStatusMeaning
CALCULATION_ERROR422Input was valid but the ephemeris computation could not complete
INTERNAL_ERROR500Our fault — safe to retry; contact us if it persists

Batch item errors

Inside a /batch response, each item carries its own { status, body } envelope — a failing item reports its own error from the tables above without failing the batch. See Batch & field filtering.