# Emtia vadeli pozisyonları (SBX-EMTIA)

CFTC Commitments of Traders: buğday, pamuk, bakır, altın ve petrol dahil 30 vadeli piyasada haftalık pozisyonlar ve açık pozisyon, 2006'dan beri.

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/commodity-futures/...?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": ["commodity-futures"]}` 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/commodity-futures/markets

**List futures markets**

The 30 commodity futures markets covered — grains, oilseeds, softs, livestock, metals, energy and lumber on CBOT, CME, COMEX, NYMEX, ICE Futures U.S. and MIAX — with the contract size and the reports held. Free.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `category` | query | string (`grains`, `oilseeds`, `softs`, `livestock`, `base-metals`, `precious-metals`, `energy`, `forest-products`) | hayır | Only this category. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/commodity-futures/markets" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/commodity-futures/positions

**Latest positions**

Each market's latest Commitments of Traders report (or the one on or before `date`): open interest and the long, short and spread contracts of producers/merchants, swap dealers, managed money, other reportables and non-reportables, with each group's net position and the change since the week before. Positions are as of Tuesday and released the following Friday at 15:30 US Eastern.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `markets` | query | string | hayır | Comma-separated market codes, e.g. wheat-srw,cotton,copper. Default: every market. |
| `category` | query | string (`grains`, `oilseeds`, `softs`, `livestock`, `base-metals`, `precious-metals`, `energy`, `forest-products`) | hayır | Only this category. |
| `date` | query | string | hayır | YYYY-MM-DD, since 2006-06-13. Default: the latest report. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/commodity-futures/positions" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/commodity-futures/positions/{market}

**One market over time**

One market's weekly reports between `start` and `end` (default: the last 52 weeks; at most about 5 years), since 2006-06-13.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `market` | path | string | evet | A market code from /commodity-futures/markets, e.g. cotton. |
| `start` | query | string | hayır | YYYY-MM-DD. |
| `end` | query | string | hayır | YYYY-MM-DD. Default: today. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/commodity-futures/positions/<market>" \
  -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/commodity-futures/openapi.json
- Fiyatlandırma: https://servicebox.io/pricing?api=SBX-EMTIA
- API sayfası: https://servicebox.io/apis/commodity-futures
