تخطي إلى المحتوى الرئيسي
24 ذُو الحِجَّة 1447 هـ
eSalah
تسجيل الدخول

🔌 Developer API

A small set of free, read-only, CORS-open JSON endpoints — the same ones that power eSalah and its embed widgets. No API key is needed for the public tier.

Base URL: https://esalah.com Rate limit: 60 req/min/IP CORS: * Auth: none
Errors use a typed JSON envelope: { "error": "validation_error", "message": "…" } with the matching HTTP status (400 invalid params, 404 not found, 429 rate-limited). Need higher limits, a commercial license, or bulk exports? Get in touch.
GET /api/v1/times

Prayer times for a coordinate, date, and calculation method.

lat* Latitude (−90…90).
lng* Longitude (−180…180).
method Calculation method slug (e.g. isna, mwl, umm-al-qura, karachi, egyptian, jafari). Defaults to the country default.
date YYYY-MM-DD. Defaults to today.
timezone IANA tz (e.g. America/New_York). Inferred when omitted.
madhab standard | hanafi (affects Asr).

Example

curl "https://esalah.com/api/v1/times?lat=40.7&lng=-74.0&method=isna"

Response

{
  "location": { "lat": 40.7, "lng": -74, "timezone": "America/New_York" },
  "date": "2026-05-30",
  "method": { "id": 2, "slug": "isna", "name": "Islamic Society of North America" },
  "madhab": "standard",
  "times": { "Fajr": "03:52", "Sunrise": "05:28", "Dhuhr": "12:54",
             "Asr": "16:52", "Maghrib": "20:19", "Isha": "21:55" },
  "notes": []
}
GET /api/v1/qibla

Qibla bearing, cardinal direction, and great-circle distance to the Kaaba.

lat* Latitude (−90…90).
lng* Longitude (−180…180).

Example

curl "https://esalah.com/api/v1/qibla?lat=40.7&lng=-74.0"

Response

{
  "location": { "lat": 40.7, "lng": -74 },
  "bearingDegrees": 58.5,
  "cardinal": "ENE",
  "distanceKm": 10307,
  "isAtKaaba": false,
  "textReadout": "Qibla bearing: 58.5° from North (roughly ENE). 10,307 km to Makkah."
}
GET /api/v1/hijri

Convert between Gregorian and Hijri dates (Kuwaiti arithmetic algorithm).

date Gregorian YYYY-MM-DD → Hijri. Defaults to today.
hijri Hijri YYYY-M-D → Gregorian. Use instead of date.

Example

curl "https://esalah.com/api/v1/hijri?date=2026-05-28"

Response

{
  "gregorian": "2026-05-28",
  "hijri": { "year": 1447, "month": 12, "day": 11 },
  "formatted": { "en": "11 Dhu al-Hijjah 1447 AH", "ar": "11 ذُو الحِجَّة 1447 هـ" },
  "method": "mathematical-kuwaiti"
}
GET /api/v1/nearest

Closest indexed city to a coordinate pair, with ready-made URLs.

lat* Latitude (−90…90).
lng* Longitude (−180…180).
radius Max km to search (1…5000). Defaults to 100.

Example

curl "https://esalah.com/api/v1/nearest?lat=40.7&lng=-74.0"

Response

{
  "city": { "name": "Financial District", "slug": "financial-district",
            "lat": 40.70789, "lng": -74.00857, "tz": "America/New_York" },
  "region": { "name": "New York", "slug": "new-york" },
  "country": { "name": "United States", "iso2": "US", "slug": "united-states" },
  "urls": { "prayerTimes": "/prayer-times/united-states/new-york/financial-district/", "…": "…" }
}
GET /api/v1/places.json

Paginated list of directory places (mosques, halal restaurants, schools…), newest first.

type mosque | halal_restaurant | islamic_school | zakat_org | islamic_bookstore. Defaults to mosque.
country Country slug filter (e.g. united-kingdom).
limit 1…100. Defaults to 50.
offset 0…10000. Defaults to 0.

Example

curl "https://esalah.com/api/v1/places.json?type=mosque&country=united-kingdom&limit=10"

Response

{ "type": "mosque", "count": 10, "offset": 0,
  "places": [ { "id": 12345, "name": "…", "slug": "…", "lat": …, "lng": …,
                "city": "…", "country": "…", "url": "/mosques/…/" } ] }
GET /api/v1/places/<id>.json

Single place by numeric id (whitelisted public fields).

id* Numeric place id (path segment).

Example

curl "https://esalah.com/api/v1/places/12345.json"

Response

{ "id": 12345, "type": "mosque", "name": "…", "slug": "…",
  "lat": …, "lng": …, "address": "…", "city": "…", "region": "…",
  "country": "…", "url": "/mosques/…/" }
GET /api/v1/stats.json

Platform totals by vertical (mosques, halal, schools…). Cached.

Example

curl "https://esalah.com/api/v1/stats.json"

Response

{ "generated_at": "2026-05-30T08:06:55Z",
  "by_vertical": { "mosque": { "total": 156224, "cities": 13681, "countries": 169 },
                   "halal_restaurant": { "total": 11734, … } } }
← Back to eSalah