Credit ledger
/v1/billing/ledgerRequest
https://api.scrapercompany.com/v1/billing/ledgerAuthenticate with your API key in the x-api-key header (see Authentication).
Parameters
- limitintegerdefault
50min 1, max 200 - beforeinteger | nullmin 1
Return entries with an id below this.
Example request
curl "https://api.scrapercompany.com/v1/billing/ledger?limit=20" \
-H "x-api-key: $SCRAPERCOMPANY_API_KEY"Response
200 — Credit movements, newest first.
{
"entries": [
{
"id": 912,
"kind": "usage",
"amount": -5,
"balance_after": 48210,
"route": "/v1/calendar",
"request_id": "req_0123456789abcdef0123456789abcdef",
"detail": {},
"created_at": "2026-10-14T09:12:44.120000+00:00"
},
{
"id": 3,
"kind": "grant",
"amount": 50000,
"balance_after": 50000,
"detail": {
"plan": "starter",
"reason": "plan change"
},
"created_at": "2026-10-01T00:00:03.000000+00:00"
}
]
}Response fields
Fields marked required are always present; others appear when they apply.
- entriesarray of objectrequired
Newest first.
Show 8 child fieldsHide child fields
- entries[].idintegerrequired
Entry id; pass the last one as
beforeto page. - entries[].kindstringrequired
usage,grant,expiry,refund,adjustment, ... - entries[].amountintegerrequired
Signed credit change (negative for usage).
- entries[].balance_afterintegerrequired
- entries[].routestring
Route template for usage entries.
- entries[].request_idstring
x-request-idof the charged request. - entries[].detailobject
- entries[].created_atstring (date-time)required
- next_beforeinteger | nullrequired
Pass as
beforefor the next page; null on the last page.
Errors
Errors return a JSON body with a detail field. Failed requests are not charged. See Errors for the full list and retry advice.
| Status | Meaning | Retry? |
|---|---|---|
401Unauthorized | Missing or invalid API key. {"detail":"missing or invalid API key"} | No, fix the request |
404Not Found | The property, stay, job or record was not found. {"detail":"job not found"} | No, fix the request |
422Unprocessable Content | Request validation failed. {"detail":[{"loc":["body","token"],"msg":"Field required","type":"missing"}]} | No, fix the request |
429Too Many Requests | Too many requests: the key's requests-per-minute limit was exceeded, or (once credit enforcement is on) the plan's concurrent-request limit. No rate-limit or Retry-After headers are sent; back off and retry. {"detail":"rate limit 60/min exceeded"} | Yes, with backoff |
503Service Unavailable | Temporarily unavailable: a dependency of this endpoint is down, or the upstream source changed its contract. Retry later. {"detail":"database unavailable: OperationalError"} | Yes, with backoff |
Try it
- Export your key:
export SCRAPERCOMPANY_API_KEY=sk_...(no key yet? request access). - Copy the cURL example above and run it in a terminal.
- Or open the interactive playground on api.scrapercompany.com, paste your key and pick this endpoint.