Docs/Reference/Analytics API

Analytics API

Read your plan, credit balance, renewal date and usage breakdown programmatically — from an endpoint that never spends a credit.

Everything the analytics page shows is also readable as an endpoint, so a dashboard of your own, an alert, or a deploy check does not need anyone to log in.

code
GET https://api.apiverve.com/v1/analytics
This endpoint does not spend credits

Calls to it are never billed, whatever your plan. Poll it on a schedule, call it from a health check, read it on every deploy — it does not consume the allowance it is reporting on.

Making the call

bash
curl 'https://api.apiverve.com/v1/analytics' \
  -H 'x-api-key: YOUR_API_KEY'

GET only; anything else is 405. A sub-key works and reports the parent account's figures, because that is where the credits actually live.

The summary

Every valid key gets this block, on every plan:

json
{
  "status": "ok",
  "error": null,
  "data": {
    "summary": {
      "plan": "starter",
      "tokensUsed": 12480,
      "tokensRemaining": 87520,
      "tokensLimit": 100000,
      "bonusTokens": 0,
      "usagePercent": 12,
      "renewalDate": "2026-09-01",
      "rateLimit": "60 requests/minute",
      "isTrialEligible": true,
      "trialCredits": 2000
    },
    "detailed": false
  }
}
Field
planThe plan id on the account
tokensUsedCredits spent this cycle
tokensRemainingWhat is left. 0 means calls are being refused
tokensLimitThe ceiling — plan allowance plus any top-ups
bonusTokensTop-up credits included in the ceiling
usagePercenttokensUsed as a percentage of the ceiling
renewalDateWhen the allowance resets, YYYY-MM-DD
rateLimitThe per-minute ceiling, or unlimited
isTrialEligibleWhether this account can still start a trial
trialCreditsHow many credits that trial grants

The last two are there so a product built on top of this does not have to hardcode trial terms. trialCredits is read from the published plan data rather than baked in, so it stays right when the offer changes. isTrialEligible is a heuristic: it is true for a free account that has never had a payment record. It cannot see whether a trial was used and cancelled long ago, and it deliberately answers false when the check itself fails, so it under-promises rather than advertising a trial that will be refused.

Because it costs nothing and answers for any valid key, this doubles as a key check: a 200 with a summary means the key is real and tells you which account and plan it belongs to. A 401 means it is not. That is a better readiness probe than calling a real endpoint, which costs a credit to learn the same thing.

The detail

On Pro and Mega the response also carries the breakdown:

json
{
  "data": {
    "summary": { "…": "…" },
    "detailed": true,
    "daily": { "2026-08-15": 412, "2026-08-16": 508, "2026-08-17": 377 },
    "byApi": { "emailvalidator": 8102, "weather": 3140, "vindecoder": 1238 },
    "lastActivity": "2026-08-17 14:32:08"
  }
}
Field
dailyCalls per day for the last 30 days, keyed by date
byApiCalls per endpoint
lastActivityThe most recent call, YYYY-MM-DD HH:mm:ss

On plans without it, detailed is false and a premium block names what is missing and where to change it:

json
{
  "detailed": false,
  "premium": {
    "message": "Detailed usage analytics (daily trend + per-API breakdown) are available on Pro and Mega plans.",
    "locked_features": ["analytics_detail"],
    "upgrade_url": "https://dashboard.apiverve.com/plans"
  }
}

Branch on detailed rather than probing for daily — the flag is explicit and will not change meaning.

What to build with it

A low-credit alert. Check tokensRemaining (or usagePercent) on a schedule and notify yourself before it reaches zero. The dashboard sends its own warnings at 80% and 100%; this is how you route the same signal into whatever you actually watch. See settings for the built-in emails.

A burn-rate projection. daily plus renewalDate is enough to answer "will this allowance last the cycle" — a few lines of arithmetic that turn a surprise into a plan change made on time.

A deploy check. Read plan and rateLimit at startup and fail loudly if an environment has the wrong key in it. Finding out on deploy beats finding out under load.

Your own usage panel. If you resell or embed access, byApi is what a customer-facing usage view is built from.

Reading usage without calling anything

For the current balance alone you do not need this endpoint at all. Every API response already carries it:

code
x-api-remaining-credits: 87520
x-api-max-credits: 100000
x-api-credits-used: 12480

Those are exact and current on calls you were making anyway. Use the headers for continuous awareness inside your integration, and this endpoint when you want the shape of usage over time or a figure without making a real call. See headers.

Errors

Status
401Key missing, invalid or expired
405Something other than GET
500The analytics store could not be read. Retry

There is no 429 for credit exhaustion here — an account with no credits left can still read that fact, which is the point.

Next

Analytics is the same data with charts. Rate limits explains the ceilings this endpoint reports, and headers covers the per-call figures.

Was this page helpful?

Last updated