Skip to content
Docs
Billing

Credit ledger

Credit movements newest first, one page at a time.

GET/v1/billing/ledger
FreeTry it

Each row names the route and the amount, so a bill can be reconciled against the calls that caused it. Paginate with before using the next_before value from the previous page. Free.

Request

GEThttps://api.scrapercompany.com/v1/billing/ledger

Authenticate with your API key in the x-api-key header (see Authentication).

Run this request on your own API key from this page, with the values you type. Signed out? Sign in or get an API key.

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.

200 response
{
  "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 fields
    • entries[].idintegerrequired

      Entry id; pass the last one as before to 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-id of the charged request.

    • entries[].detailobject
    • entries[].created_atstring (date-time)required
  • next_beforeinteger | nullrequired

    Pass as before for 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.

StatusMeaningRetry?
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 (in enforce credits mode) 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

Press Try it above to run this request on your own key, with the values you type (sign in first). For a no-code walkthrough, use the workspace’s guided Try it.

  1. Export your key: export SCRAPERCOMPANY_API_KEY=sk_... (no key yet? start a free trial).
  2. Copy the cURL example above and run it in a terminal.

Questions about this page?

Send the page link and your question, and the team will answer.

Email support