curl "https://developer.encrata.com/api/account/credits" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
{
"credits_remaining": 4794,
"credits_used": 206,
"total_lookups": 206,
"stats_degraded": false
}
{ "error": "invalid API key" }
Account
Credits
Check the remaining credit balance and usage for your account.
GET
/
api
/
account
/
credits
curl "https://developer.encrata.com/api/account/credits" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
{
"credits_remaining": 4794,
"credits_used": 206,
"total_lookups": 206,
"stats_degraded": false
}
{ "error": "invalid API key" }
Authentication
Requires an API key in theAuthorization header.
Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request
No parameters required. The balance is scoped to the API key’s active workspace when one is selected, otherwise to the key owner’s account.curl "https://developer.encrata.com/api/account/credits" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Response
true only when the lifetime counters (credits_used, total_lookups) timed
out and read 0. credits_remaining is always accurate; this flag distinguishes
a degraded read from a brand-new account.Errors
Errors return a JSON body of the form{"error": "<message>"} with the matching
HTTP status code.
| Status | Message | Cause |
|---|---|---|
401 | unauthorized / invalid API key | Missing or invalid API key |
402 | api key credit limit exceeded | The key has hit its own credit_limit. See Set key credit limit |
405 | Only GET method is allowed | Wrong HTTP method |
500 | failed to fetch credits | The balance could not be read |
curl "https://developer.encrata.com/api/account/credits" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
{
"credits_remaining": 4794,
"credits_used": 206,
"total_lookups": 206,
"stats_degraded": false
}
{ "error": "invalid API key" }
Was this page helpful?