> ## Documentation Index
> Fetch the complete documentation index at: https://pricepirate.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitor usage

> Read your balance, limits, usage, credit ledger, and plan with your API key.

You can monitor your account in two ways:

* **Usage headers** on every job you create and poll. They cost no extra request.
* **Account endpoints** under `/api/v2/account` for balance, limits, usage, ledger, and plan.

All account endpoints are read-only and free. They use the same `x-api-key` as your jobs.

## Usage headers

### On job creation

`POST /api/v2/jobs` responses report your headroom after this request:

| Header | Value |
| - | - |
| `X-Credits-Remaining` | Spendable credits after this job's charge. On a `402`, the balance that was too low. |
| `X-Concurrency-Limit` | Your concurrent query limit. |
| `X-Concurrency-Remaining` | Queries you can still submit before reaching it, counting this job. |
| `X-Daily-Limit` | Your daily query limit. Only present when one applies. |
| `X-Daily-Remaining` | Queries left today (UTC), counting this job. Only present with a daily limit. |
| `Retry-After` | On `202`, seconds to wait before polling. On a daily-limit `429`, seconds until 00:00 UTC. |

```text theme={null}
HTTP/1.1 202 Accepted
X-Credits-Remaining: 4812
X-Concurrency-Limit: 1000
X-Concurrency-Remaining: 750
```

A header is missing when the request was refused before that number was checked. For example, a concurrency `429` carries no `X-Credits-Remaining`. The concurrency figures are advisory: parallel requests can see the same headroom.

### On polls

`GET /api/v2/jobs/{jobId}` and the CSV export report that job's own credits:

| Header | Value |
| - | - |
| `X-Credits-Used` | Credits this job costs: the full charge until it settles, final afterwards. |
| `X-Credits-Refunded` | Credits refunded for `error` results. `0` until you poll the job in a terminal status. |

Both headers also appear on the `404` of a job whose results expired. That `404` shows the charge that stands.

## Account overview

`GET /api/v2/account` returns the source/operation pairs you can use, your balance, and your current headroom:

```bash theme={null}
curl https://api-v2.pricepirate.com/api/v2/account \
  --header 'x-api-key: <api-key>'
```

```json theme={null}
{
  "name": "Acme GmbH",
  "entitlements": [
    { "source": "idealo", "operation": "search-by-gtin" },
    { "source": "amazon", "operation": "search-by-gtin" }
  ],
  "credits": { "balance": 4812 },
  "limits": {
    "concurrency": { "limit": 1000, "in_flight": 250, "remaining": 750 },
    "daily": { "limit": 20000, "used": 3100, "remaining": 16900, "resets_at": "2026-10-15T00:00:00.000Z" }
  }
}
```

`limits.daily` is `null` when no daily limit applies. Check `remaining` before you submit a large batch.

## Usage per month

`GET /api/v2/account/usage` aggregates one calendar month (UTC). Pass `period=YYYY-MM` for a past month; the default is the current month:

```bash theme={null}
curl "https://api-v2.pricepirate.com/api/v2/account/usage?period=2026-10" \
  --header 'x-api-key: <api-key>'
```

```json theme={null}
{
  "period": { "key": "2026-10", "start": "2026-10-01T00:00:00.000Z", "end": "2026-11-01T00:00:00.000Z" },
  "credits": { "granted": 50000, "debited": 45210, "refunded": 22, "remaining": 4812, "expires_at": "2026-11-01T00:00:00.000Z" },
  "totals": { "queries": 45210, "found": 39876, "not_found": 5290, "error": 22, "unsettled": 22 },
  "by_day": [
    { "date": "2026-10-14", "queries": 3100, "found": 2711, "not_found": 380, "error": 4 }
  ],
  "by_endpoint": [
    {
      "source": "idealo",
      "operation": "search-by-gtin",
      "country": "de",
      "queries": 45210,
      "credits_debited": 45210,
      "credits_refunded": 22,
      "found": 39876,
      "not_found": 5290,
      "error": 22
    }
  ]
}
```

* `credits` comes from your credit ledger. It is the figure you are billed on.
* `totals`, `by_day`, and `by_endpoint` come from your jobs.
* `unsettled` counts queries in jobs never polled to completion. Their outcome is unknown.
* For the current month, `credits.remaining` is your spendable balance now. For a past month, it is what that month's grants still held when they expired.

`GET /api/v2/account/usage/periods` lists every month since your account was created.

## Credits and ledger

`GET /api/v2/account/credits` returns your balance, the grants it consists of, and every credit movement, newest first:

```json theme={null}
{
  "balance": 4812,
  "buckets": [
    { "id": "cm1...", "type": "subscription", "amount": 50000, "remaining": 4812, "expires_at": "2026-11-01T00:00:00.000Z" }
  ],
  "transactions": [
    { "id": "cm2...", "type": "refund", "amount": 1, "job_id": "3f6c0a7e-...", "created_at": "2026-10-14T09:12:41.000Z" },
    { "id": "cm3...", "type": "debit", "amount": 2, "job_id": "3f6c0a7e-...", "created_at": "2026-10-14T09:12:03.000Z" }
  ],
  "next_cursor": "18342"
}
```

`amount` is always positive; `type` (`grant`, `debit`, `refund`) gives the direction. Page with `limit` (1–200) and `cursor`.

## Billing

`GET /api/v2/account/billing` returns your plan as managed in the dashboard:

```json theme={null}
{
  "subscription": {
    "plan": "50k",
    "cadence": "monthly",
    "currency": "eur",
    "status": "active",
    "current_period_end": "2026-11-01T00:00:00.000Z",
    "cancel_at_period_end": false,
    "pending_change": null
  },
  "allowance": { "amount": 50000, "remaining": 4812, "expires_at": "2026-11-01T00:00:00.000Z" },
  "additional_credits": 0,
  "pending_payment": false,
  "low_credits": true
}
```

* `subscription` is `null` without an active plan, including enterprise contracts.
* `low_credits` is `true` when less than 20% of your allowance remains.
* `pending_payment` is `true` while a payment is open or has failed.

To buy credits or change your plan, use **Billing** in the dashboard. See [Credits and billing](https://pricepirate.com/docs/en/api/price-data/credits-and-billing.md#buy-and-manage-your-plan).

## Job history

`GET /api/v2/jobs` lists your jobs with what each was billed and refunded. See [List your jobs](https://pricepirate.com/docs/en/api/price-data/jobs.md#list-your-jobs).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.