# Kamu ihale istatistikleri (SBX-IHALE)

EKAP kayıtlarından kamu ihale istatistikleri: rekabet, doğrudan temin, yerli tedarikçi payı, yoğunlaşma, il ve sektör hacimleri ve en büyük 10 kurum ile yüklenici.

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/public-procurement/...?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": ["public-procurement"]}` 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/public-procurement/authority-types

**List authority types**

The kinds of buying authority (ministries, municipalities, universities, state-owned enterprises…). Free.

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

Parametre yok.

**Örnek**

```bash
curl "https://api.servicebox.io/v1/public-procurement/authority-types" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/public-procurement/competition-indices

**Competition**

Tender competition per year: the number of tenders, the share won with a single bid (overall and for single-lot tenders), average lots and the average discount against the estimated cost — for the whole country or per province, sector, tender procedure or authority type. Robust for 2019–2024; the source's 2025–2026 result details are partial.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `dimension` | query | string (`overall`, `province`, `sector`, `procedure`, `authority-type`) | hayır | What to break down by. Default: `overall` (the whole country). |
| `subject` | query | string | hayır | One subject of the dimension: a province's plate code or name (34, İstanbul), a sector id or name, an authority-type id, or a procedure id. Default: every subject. |
| `period` | query | string | hayır | A year (2019–) or `all` (every year pooled). Default: every year and `all`. |
| `limit` | query | integer | hayır | Items per page, 1–200. |
| `cursor` | query | string | hayır | The `next_cursor` of the previous page, with the same filters. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/public-procurement/competition-indices" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/public-procurement/concentration-indices

**Market concentration**

How concentrated contract winners are, per year: contract and firm counts, the largest 1, 4 and 10 contractors' share of value and the Herfindahl–Hirschman index — for the whole country or per province or sector.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `dimension` | query | string (`overall`, `province`, `sector`) | hayır | What to break down by. Default: `overall` (the whole country). |
| `subject` | query | string | hayır | One subject of the dimension: a province's plate code or name (34, İstanbul), a sector id or name, an authority-type id, or a procedure id. Default: every subject. |
| `period` | query | string | hayır | A year (2019–) or `all` (every year pooled). Default: every year and `all`. |
| `limit` | query | integer | hayır | Items per page, 1–200. |
| `cursor` | query | string | hayır | The `next_cursor` of the previous page, with the same filters. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/public-procurement/concentration-indices" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/public-procurement/datasets

**Source datasets and release**

The weekly release served, when it was loaded, and each source dataset with its row count and the citation its publisher asks for. Free.

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

Parametre yok.

**Örnek**

```bash
curl "https://api.servicebox.io/v1/public-procurement/datasets" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/public-procurement/direct-procurement-indices

**Direct procurement**

Direct procurement (doğrudan temin) per year: purchase count and the amount distribution (median, mean, total, 95th and 99th percentile, largest and its share), nominal TRY — for the whole country or per province, sector or authority type. 2025 is the reference year; earlier years are incomplete in the source.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `dimension` | query | string (`overall`, `province`, `sector`, `authority-type`) | hayır | What to break down by. Default: `overall` (the whole country). |
| `subject` | query | string | hayır | One subject of the dimension: a province's plate code or name (34, İstanbul), a sector id or name, an authority-type id, or a procedure id. Default: every subject. |
| `period` | query | string | hayır | A year (2019–) or `all` (every year pooled). Default: every year and `all`. |
| `limit` | query | integer | hayır | Items per page, 1–200. |
| `cursor` | query | string | hayır | The `next_cursor` of the previous page, with the same filters. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/public-procurement/direct-procurement-indices" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/public-procurement/localization-indices

**Local suppliers**

The share of contracts, by count and by value, won by suppliers from the buying authority's own province, per year — for the whole country or per province or sector.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `dimension` | query | string (`overall`, `province`, `sector`) | hayır | What to break down by. Default: `overall` (the whole country). |
| `subject` | query | string | hayır | One subject of the dimension: a province's plate code or name (34, İstanbul), a sector id or name, an authority-type id, or a procedure id. Default: every subject. |
| `period` | query | string | hayır | A year (2019–) or `all` (every year pooled). Default: every year and `all`. |
| `limit` | query | integer | hayır | Items per page, 1–200. |
| `cursor` | query | string | hayır | The `next_cursor` of the previous page, with the same filters. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/public-procurement/localization-indices" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/public-procurement/province-sectors

**Volume by province and sector**

Tender volume (count and value, nominal TRY) for each province and sector, with the value won by suppliers from the same province and from elsewhere. Largest first.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `province` | query | string | hayır | A province's plate code or name. |
| `sector` | query | string | hayır | A sector id from /public-procurement/sectors, or its Turkish or English name. |
| `sort` | query | string (`amount`, `tenders`) | hayır | `amount` (default) or `tenders`, both descending. |
| `limit` | query | integer | hayır | Items per page, 1–200. |
| `cursor` | query | string | hayır | The `next_cursor` of the previous page, with the same filters. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/public-procurement/province-sectors" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/public-procurement/sectors

**List sectors**

The 43 sectors tenders are classified into, with ids and English names. Free.

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

Parametre yok.

**Örnek**

```bash
curl "https://api.servicebox.io/v1/public-procurement/sectors" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/public-procurement/supply-flows

**Supply flows between provinces**

Contracts (count and value, nominal TRY) from authorities in one province to suppliers based in another or the same province. Largest first.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `buyerProvince` | query | string | hayır | The buying authorities' province: plate code or name. |
| `supplierProvince` | query | string | hayır | The suppliers' province: plate code or name. |
| `limit` | query | integer | hayır | Items per page, 1–200. |
| `cursor` | query | string | hayır | The `next_cursor` of the previous page, with the same filters. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/public-procurement/supply-flows" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/public-procurement/top-authorities

**Top-10 buying authorities**

The ten public authorities that awarded the most in one province (tenders or direct procurement) or one sector (tenders), by value.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `province` | query | string | hayır | A province's plate code or name. Give this or `sector`. |
| `sector` | query | string | hayır | A sector id or name. Give this or `province`. |
| `method` | query | string (`tender`, `direct`) | hayır | `tender` (default) or, for a province, `direct` (direct procurement). |
| `limit` | query | integer | hayır | Items per page, 1–200. |
| `cursor` | query | string | hayır | The `next_cursor` of the previous page, with the same filters. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/public-procurement/top-authorities" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/public-procurement/top-contractors

**Top-10 contractors**

The ten contractors that won the most in one province or sector (tenders), in one province by direct procurement (`direct`), or the ten firms based in a province with the most public-contract revenue anywhere (`headquartered`). Legal names as recorded in EKAP; no tax numbers.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `province` | query | string | hayır | A province's plate code or name. Give this or `sector`. |
| `sector` | query | string | hayır | A sector id or name. Give this or `province`. |
| `method` | query | string (`tender`, `direct`, `headquartered`) | hayır | `tender` (default); for a province also `direct` or `headquartered`. |
| `limit` | query | integer | hayır | Items per page, 1–200. |
| `cursor` | query | string | hayır | The `next_cursor` of the previous page, with the same filters. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/public-procurement/top-contractors" \
  -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/public-procurement/openapi.json
- Fiyatlandırma: https://servicebox.io/pricing?api=SBX-IHALE
- API sayfası: https://servicebox.io/apis/public-procurement
