LifeAstroAPILifeAstroAPI

Errors

Every error response is JSON with a consistent envelope:

{
  "error": {
    "code": "missing_param",
    "message": "lat and lon are required",
    "request_id": "770372810e5f2a70"
  }
}

code is a stable machine-readable string (listed below); message is human-readable and may change; request_id matches the X-Request-ID response header.

HTTP status codes

StatusMeaning
200Success.
400Invalid request — missing or malformed parameter.
401Missing, unknown or revoked API key.
402Payment required — no credits left, or free-tier cap reached.
403Request IP not in the key's allowlist, account suspended, or a feature that needs a higher plan.
404Unknown endpoint or sub-resource (e.g. an unknown varga or planet name).
405Wrong HTTP method (compute endpoints are GET).
422The request is valid but has no answer for this place or date (see data_unavailable).
429Rate limit hit — wait for Retry-After seconds.
500Internal error — retry with backoff; include request_id when reporting.
503Billing/data service temporarily unavailable — retry after a short wait.
504Request exceeded the server deadline — retry once; simplify if it repeats.

Error codes

Each code has its own page with the cause and the fix: Troubleshooting.

CodeStatusMeaning
missing_param400A required query parameter was not supplied.
invalid_param400A parameter is malformed (bad date, unknown timezone, out-of-range lat/lon).
bad_request400Malformed request body or unsupported combination.
unauthorized401Bearer token missing, unknown, or revoked.
insufficient_credits402Paid / PAYG account has no credits left — top up or upgrade.
daily_cap_exceeded402Free tier: the day's total has reached the daily limit (1,000 credits while welcome credits are active, 500 after). A call that starts under the limit runs in full. Resets at 00:00 UTC (05:30 IST).
monthly_cap_exceeded402Free tier: the 1,500-credit monthly cap (and any welcome bonus) is used up.
trial_exhausted402Trial credits used up.
quota_exhausted402Plan credits for the period are used and the wallet is empty.
payment_required402Generic payment-required condition (see message).
ip_not_allowed403Request origin IP is not in the key's allowlist.
account_suspended403Account suspended — contact support.
forbidden403Authenticated, but not allowed to perform this action.
plan_required403A dashboard setting that needs a higher plan (IP allowlisting is on Business, Scale and Enterprise).
not_found404Unknown endpoint or sub-resource.
method_not_allowed405Wrong HTTP method.
rate_limited429Too many requests for your plan's per-minute limit.
data_unavailable422No answer exists for this input: the Sun does not rise or set at this latitude on this date, or houses cannot be cast inside the polar circle. Do not retry.
data_unavailable503Ephemeris/geo data unavailable for the requested input.
billing_unavailable503Billing service unreachable — retry shortly.
internal_error500Unhandled error. Reference request_id when reporting.

Rate-limit and credit headers

Every authenticated response carries:

X-RateLimit-Limit: 30         # requests per minute for your plan (30 on the free plan)
X-RateLimit-Remaining: 29
X-RateLimit-Reset: 1789363680 # unix seconds when the window resets
X-Credits-Remaining: 1970     # bought credits left, when the call was paid from them
Retry-After: 12               # only on 429

X-Credits-Remaining is your balance of bought credits (plan and wallet) after the call. It is sent when the call was paid from bought credits. Calls covered by the free allowance or by welcome credits do not carry it; the dashboard shows what is left of those. Welcome credits stay usable after a top-up or plan purchase and are spent before bought credits. A failed call costs nothing.

Call the API from your server: it sends CORS headers only for lifeastroapi.com, so browser code on another site cannot read these responses.

Retry semantics

  • 429: wait Retry-After seconds, then retry.
  • 500 / 503 / 504: retry with exponential backoff (1s, 2s, 4s, 8s — max 5 attempts).
  • Other 4xx (including 422): do not retry — the request is deterministically invalid. Fix the parameters, top up credits, or fix the key/IP.

Request ID

Every response (success or error) includes X-Request-ID (16 hex characters). When reporting an issue, always include it — it lets us pull the exact trace from our logs.

X-Request-ID: 52a520f261d3db37