How to fix daily_cap_exceeded (HTTP 402)
The free tier allows 500 credits a day (about 50 basic calls). Today's allowance is used up.
What the API returns
{
"error": {
"code": "daily_cap_exceeded",
"message": "free-plan daily limit reached — try again tomorrow or upgrade to a paid plan",
"request_id": "770372810e5f2a70"
}
}Why it happens
- A loop or a page that calls the API on every render.
- Calling the API for every user request instead of caching results that do not change (a day's panchang changes once a day).
- Running a benchmark or a full endpoint sweep on a free key.
How to fix it
- Cache responses keyed by (endpoint, date, lat, lon, tz); panchang and festival data can be cached for the whole day.
- Wait for the reset at midnight IST (18:30 UTC), or upgrade: paid plans have no daily cap.
- Read X-Credits-Remaining on every response and stop before it reaches zero.
Should your code retry?
Not automatically. Retrying will return the same error until credits are available; surface it to whoever manages the account.
See all codes on the troubleshooting index and the error envelope on Errors. Still stuck? Email [email protected] with the request_id.