# Credit ledger: `GET /v1/billing/ledger`

Cost: free (0 (failed requests are free)). Docs: https://scrapercompany.com/docs/reference/billing-ledger

Credit movements newest first, one page at a time.

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.

Parameters:

- `limit` (integer; optional; default 50; min 1, max 200)
- `before` (integer | null; optional; min 1): Return entries with an id below this.

Response fields:

- `entries` (array of object; required): Newest first.
  - `entries[].id` (integer; required): Entry id; pass the last one as `before` to page.
  - `entries[].kind` (string; required): `usage`, `grant`, `expiry`, `refund`, `adjustment`, ...
  - `entries[].amount` (integer; required): Signed credit change (negative for usage).
  - `entries[].balance_after` (integer; required)
  - `entries[].route` (string; optional): Route template for usage entries.
  - `entries[].request_id` (string; optional): `x-request-id` of the charged request.
  - `entries[].detail` (object; optional)
  - `entries[].created_at` (string (date-time); required)
- `next_before` (integer | null; required): Pass as `before` for the next page; null on the last page.

Base URL: `https://api.scrapercompany.com`. Auth: send your key in the `x-api-key` header. A failed request (4xx or 5xx) or an empty result costs 0 credits.

- [Full API reference as one Markdown file](https://scrapercompany.com/llms-full.txt)
- [OpenAPI spec](https://scrapercompany.com/openapi.json)
