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

# Credits

> Understand the credit-based billing system

## How credits work

Every API key has a credit balance. Each scrape request deducts a fixed number of credits. Credits are deducted on both cache hits and fresh scrapes — you're paying for the data, not the compute.

## Credit costs

| Endpoint                          | Credits | Description               |
| --------------------------------- | ------- | ------------------------- |
| `GET /v1/instagram/profile`       | 1       | Single profile lookup     |
| `GET /v1/instagram/user/posts`    | 2       | User's recent posts       |
| `GET /v1/instagram/post`          | 1       | Single post by shortcode  |
| `GET /v1/instagram/post/comments` | 2       | Comments on a post        |
| `GET /v1/credit-balance`          | 0       | Check your balance (free) |

## Checking your balance

<CodeGroup>
  ```bash cURL theme={null}
  curl -H "x-api-key: sk-your-api-key" \
    https://api.scraper.creatorlookup.com/v1/credit-balance
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    "https://api.scraper.creatorlookup.com/v1/credit-balance",
    { headers: { "x-api-key": "sk-your-api-key" } }
  );
  console.log(await res.json());
  // { "credits_remaining": 9500 }
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
      "https://api.scraper.creatorlookup.com/v1/credit-balance",
      headers={"x-api-key": "sk-your-api-key"},
  )
  print(res.json())
  # {"credits_remaining": 9500}
  ```
</CodeGroup>

Every successful scrape response also includes credit info:

```json theme={null}
{
  "data": { ... },
  "credits_used": 2,
  "credits_remaining": 9498
}
```

## Insufficient credits

If your balance is too low for a request, you'll receive a `402` error:

```json theme={null}
{
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "This endpoint requires 2 credits, you have 1"
  }
}
```

The request is not processed and no credits are deducted.

## Credit deduction rules

* Credits are deducted **only on successful responses** (HTTP 2xx)
* Failed scrapes (502, 504) do not cost credits
* Cached responses still cost credits (same rate as fresh scrapes)
* The `credit-balance` endpoint is always free
