# Prices API

> What each task type costs now and the next change scheduled: public, with no key or session, and cacheable.

Source: https://zerocaptcha.io/docs/reference/api/prices

## List prices

`GET /v1/prices` (`listPrices`)

What each task type costs: the price a task created now is charged if it
succeeds, and the next change already scheduled. It needs no key or
session. Production lists approved prices only; a task type without one is
listed with no price in effect, and its tasks are refused until it has one.
A task is always charged the price in effect when it was created. Every
caller gets the same reply, which caches may keep for up to five minutes;
send the `ETag` of a reply you hold as `If-None-Match` to get 304 while it
is current. Requests have a budget per client address.

| Parameter | In | Required | What it is |
| --- | --- | --- | --- |
| `If-None-Match` | header | no | The `ETag` of a reply you hold. While the prices are unchanged, the reply is 304 with no body. |

Responses:

- 200 OK: The prices.
- 304 Not Modified: The prices are those of the reply whose `ETag` was sent: keep using it.
- 429 Too Many Requests: Over the budget of this client address (`rate_limited`); retry after `Retry-After`, and keep a copy of the list rather than asking again.
- 503 Service Unavailable: The prices cannot be read now (`service_unavailable`): the database cannot be reached, or this instance is shedding load. Retry shortly.
- Any other status: An error, as RFC 9457 problem details.

```bash
curl https://api.zerocaptcha.io/v1/prices
```

```js
const response = await fetch("https://api.zerocaptcha.io/v1/prices");
console.log(response.status, await response.text());
```

```python
import requests

response = requests.get(
    "https://api.zerocaptcha.io/v1/prices",
    timeout=30,
)
print(response.status_code, response.text)
```
