# Crypto (SBX-CRY)

The top 500 crypto assets: USD, EUR and TRY price, market cap, volume and change (every 5 minutes), hourly and daily price history, and whole-market metrics.

Version: v1.0

## Authentication

Send your API key on every request, either as a Bearer token or as the `apikey` query parameter:

```
Authorization: Bearer <YOUR_API_KEY>
https://api.servicebox.io/v1/crypto/...?apikey=<YOUR_API_KEY>
```

Get a key: sign up at https://servicebox.io/en/signup and create one on the dashboard. An agent can sign up itself with `POST https://api.servicebox.io/v1/accounts` and `{"email": "...", "apis": ["crypto"]}`: the owner of the mailbox approves by email and the agent collects a short-lived key by polling the returned `poll_url`.

## Base URL

`https://api.servicebox.io`

## Endpoints

### GET /v1/crypto/assets

**List crypto assets**

The top 500 crypto assets by market cap, with their CoinMarketCap id, slug, symbol and rank. Free.

**Credits:** free (0 credits per call)

No parameters.

**Example**

```bash
curl "https://api.servicebox.io/v1/crypto/assets" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/crypto/global

**Whole-market metrics**

Total market cap and its 24-hour change, 24-hour volume, Bitcoin and Ethereum dominance, stablecoin and DeFi market caps, derivatives volume, and the number of active assets and exchanges. Refreshed hourly.

**Credits:** 1 per call

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `quote` | query | string (`USD`, `EUR`, `TRY`) | no | `USD` (default), `EUR` (at the ECB's latest USD rate) or `TRY` (at TCMB's latest forex midpoint). |

**Example**

```bash
curl "https://api.servicebox.io/v1/crypto/global" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/crypto/prices/{asset}

**Price history**

One asset's price, market cap and 24-hour volume over time, as ServiceBox recorded it: `1h` (top 200, the last 90 days; at most 31 days a request, default 1) or `1d` (top 500, at 00:00 UTC; at most 5 years, default 30). History starts on 2026-09-28. EUR and TRY points use each day's rate.

**Credits:** 1 per call

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `asset` | path | string | yes | A slug (bitcoin), symbol (BTC) or CoinMarketCap id from /crypto/assets. |
| `interval` | query | string (`1d`, `1h`) | no | `1d` (default) or `1h`. |
| `quote` | query | string (`USD`, `EUR`, `TRY`) | no | `USD` (default), `EUR` (at the ECB's latest USD rate) or `TRY` (at TCMB's latest forex midpoint). |
| `start` | query | string | no | YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ. |
| `end` | query | string | no | YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ. Default: now. |

**Example**

```bash
curl "https://api.servicebox.io/v1/crypto/prices/<asset>" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/crypto/tickers

**Latest market data**

Price, market cap, fully diluted cap, 24-hour volume, 1-hour to 30-day changes, dominance and supply of the top `limit` assets (default 100, at most 500) or of `assets`. The top 200 are refreshed every 5 minutes, ranks 201–500 every 30; `lastUpdated` says when CoinMarketCap last priced each. EUR and TRY are converted from USD at daily official rates (`meta.conversion`).

**Credits:** 1 per call

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `quote` | query | string (`USD`, `EUR`, `TRY`) | no | `USD` (default), `EUR` (at the ECB's latest USD rate) or `TRY` (at TCMB's latest forex midpoint). |
| `assets` | query | string | no | Comma-separated slugs, symbols or ids, e.g. bitcoin,ETH,5426 (at most 100). |
| `limit` | query | integer | no | 1–500. |

**Example**

```bash
curl "https://api.servicebox.io/v1/crypto/tickers" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

## Errors

Errors are RFC 9457 `application/problem+json` bodies with a machine-readable `type`.

- `401` — the key is missing, unknown, expired or revoked.
- `402` — not enough credits: the body carries `credits_required` and `upgrade_url` (https://servicebox.io/en/pricing).
- `403` — the key is not allowed to call this API.
- `429` — rate limited: wait `retry_after` seconds (also sent as the `Retry-After` header); `upgrade_url` points to a larger plan.

## Links

- OpenAPI document: https://api.servicebox.io/v1/crypto/openapi.json
- Pricing: https://servicebox.io/en/pricing?api=SBX-CRY
- API page: https://servicebox.io/en/apis/crypto
