# Kripto (SBX-CRY)

En büyük 500 kripto varlık: USD, EUR ve TL fiyat, piyasa değeri, hacim ve değişim (5 dakikada bir), saatlik ve günlük fiyat geçmişi, toplam piyasa verileri.

Sürüm: v1.0

## Kimlik doğrulama

API anahtarınızı her istekte Bearer token olarak ya da `apikey` sorgu parametresiyle gönderin:

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

Anahtar almak için https://servicebox.io/signup adresinden kaydolun ve panelden bir anahtar oluşturun. Bir ajan `POST https://api.servicebox.io/v1/accounts` ve `{"email": "...", "apis": ["crypto"]}` ile kendisi kaydolabilir: e-posta sahibi e-postadaki bağlantıyla onaylar, ajan dönen `poll_url` adresini yoklayarak kısa ömürlü bir anahtar alır.

## Temel URL

`https://api.servicebox.io`

## Uç noktalar

### GET /v1/crypto/assets

**List crypto assets**

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

**Kredi:** ücretsiz (çağrı başına 0 kredi)

Parametre yok.

**Örnek**

```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.

**Kredi:** çağrı başına 1

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `quote` | query | string (`USD`, `EUR`, `TRY`) | hayır | `USD` (default), `EUR` (at the ECB's latest USD rate) or `TRY` (at TCMB's latest forex midpoint). |

**Örnek**

```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.

**Kredi:** çağrı başına 1

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `asset` | path | string | evet | A slug (bitcoin), symbol (BTC) or CoinMarketCap id from /crypto/assets. |
| `interval` | query | string (`1d`, `1h`) | hayır | `1d` (default) or `1h`. |
| `quote` | query | string (`USD`, `EUR`, `TRY`) | hayır | `USD` (default), `EUR` (at the ECB's latest USD rate) or `TRY` (at TCMB's latest forex midpoint). |
| `start` | query | string | hayır | YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ. |
| `end` | query | string | hayır | YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ. Default: now. |

**Örnek**

```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`).

**Kredi:** çağrı başına 1

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `quote` | query | string (`USD`, `EUR`, `TRY`) | hayır | `USD` (default), `EUR` (at the ECB's latest USD rate) or `TRY` (at TCMB's latest forex midpoint). |
| `assets` | query | string | hayır | Comma-separated slugs, symbols or ids, e.g. bitcoin,ETH,5426 (at most 100). |
| `limit` | query | integer | hayır | 1–500. |

**Örnek**

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

## Hatalar

Hatalar, makinece okunabilir bir `type` taşıyan RFC 9457 `application/problem+json` gövdeleridir.

- `401` — anahtar eksik, bilinmiyor, süresi dolmuş ya da iptal edilmiş.
- `402` — kredi yetersiz: gövde `credits_required` ve `upgrade_url` (https://servicebox.io/pricing) taşır.
- `403` — anahtarın bu API'yi çağırma izni yok.
- `429` — hız sınırı: `retry_after` saniye bekleyin (`Retry-After` başlığıyla da gönderilir); `upgrade_url` daha büyük bir plana yönlendirir.

## Bağlantılar

- OpenAPI belgesi: https://api.servicebox.io/v1/crypto/openapi.json
- Fiyatlandırma: https://servicebox.io/pricing?api=SBX-CRY
- API sayfası: https://servicebox.io/apis/crypto
