# Namaz vakitleri (SBX-PRAY)

Her şehir ya da koordinat için günlük namaz vakitleri; varsayılan Diyanet yöntemi, 11 yöntem daha ve kıble yönü.

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/prayer-times/...?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": ["prayer-times"]}` 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/prayer-times/days

**Get prayer times**

The five daily prayer times and sunrise for a city (`cityId`, from the Cities API) or a point (`lat`, `lon`), for one day or up to 31 days from `date` (default: today there). The timezone is the city's, or the nearest city's for a point, unless `timezone` is given. The default method `turkey` follows the Turkish Presidency of Religious Affairs (Diyanet: İmsak 18°, Yatsı 17°, with its minute adjustments); results can differ from Diyanet's published table by a minute or two. `meta.qiblaDegrees` is the Qibla direction, clockwise from true north.

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

**Parametreler**

| Ad | Yer | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
| `cityId` | query | string | hayır | A city id from the Cities API, e.g. 745044 (İstanbul). |
| `lat` | query | number | hayır | Latitude (WGS84), with `lon`. |
| `lon` | query | number | hayır | Longitude (WGS84), with `lat`. |
| `date` | query | string | hayır | First day, YYYY-MM-DD. Default: today in the place's timezone. |
| `days` | query | integer | hayır | Number of days, 1–31. |
| `timezone` | query | string | hayır | IANA timezone, e.g. Europe/Istanbul. Default: the city's. |
| `method` | query | string | hayır | Calculation method (see /methods). |
| `madhab` | query | string (`shafi`, `hanafi`) | hayır | `shafi` (standard Asr, as Diyanet) or `hanafi`. |

**Örnek**

```bash
curl "https://api.servicebox.io/v1/prayer-times/days" \
  -H "Authorization: Bearer $SBX_API_KEY"
```

### GET /v1/prayer-times/methods

**List calculation methods**

The calculation methods `method` accepts, with their twilight angles. Free.

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

Parametre yok.

**Örnek**

```bash
curl "https://api.servicebox.io/v1/prayer-times/methods" \
  -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/prayer-times/openapi.json
- Fiyatlandırma: https://servicebox.io/pricing?api=SBX-PRAY
- API sayfası: https://servicebox.io/apis/prayer-times
