# Get fee rates

`GET /api/market/fees`

Network fee rates in sat/vB for a purchase: bitcoind's estimates for 6, 3 and 1 blocks, else mempool.space's; cached 30 seconds. `minimum` is the lowest `fee_rate` purchase/prepare accepts.

#### Example request

```bash title="cURL"
curl 'https://raresats.net/api/market/fees'
```
```js title="JavaScript"
const response = await fetch('https://raresats.net/api/market/fees');
const data = await response.json();
```
```python title="Python"
import requests

data = requests.get("https://raresats.net/api/market/fees").json()
```

#### Response `200`

| Field | Type | Description |
| --- | --- | --- |
| `slow` | number | About 6 blocks, sat/vB. |
| `normal` | number | About 3 blocks, sat/vB. |
| `fast` | number | Next block, sat/vB. |
| `minimum` | number | The lowest rate a purchase may use, sat/vB (never below 1). |
| `source` | string | Where the estimates came from. One of: `bitcoind`, `mempool.space`. |

```json title="Response"
{"slow": 2, "normal": 4, "fast": 8, "minimum": 1, "source": "bitcoind"}
```

#### Errors

`{error, code}`; see [Errors](https://raresats.net/docs/errors.md) for every code.

| Status | Code | Meaning |
| --- | --- | --- |
| 503 | `fees_unavailable` | No fee estimate is available. |

```json title="Error (503)"
{"error": "no fee estimate is available", "code": "fees_unavailable"}
```

Pass one of these (or any rate from `minimum` to 5000) as `fee_rate` to [Prepare a purchase](https://raresats.net/docs/prepare-purchase.md). A rate below `minimum` is refused with 422 `fee_rate_too_low`; `minimum` is never below 1 sat/vB, which some nodes require to relay.
