Prayer Times API
Precise Islamic prayer time calculations using full astronomical formulas. Supports 5 calculation methods, 2 juristic schools, 15 MENA cities, and arbitrary coordinates. Returns all six daily prayer times plus Qibla direction calculated via great-circle bearing.
/api/v1/prayer-timesTry it out
/api/v1/prayer-timesParameters
Code
curl -X GET "https://khaleejiapi.dev/api/v1/prayer-times?city=dubai&method=mwl&school=shafi" \ -H "Authorization: Bearer your_api_key"Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| city | string | Optional | City name (15 MENA cities). Required if lat/lng not provided |
| lat | number | Optional | Latitude (-90 to 90). Requires lng |
| lng | number | Optional | Longitude (-180 to 180). Requires lat |
| date | string | Optional | Date in YYYY-MM-DD format (defaults to today) |
| method | string | Optional | Calculation method: mwl, isna, egypt, makkah, karachi |
| school | string | Optional | Juristic school for Asr: shafi or hanafi |
Note: Either city or both lat/lng must be provided.
Calculation Methods
| ID | Name | Fajr Angle | Isha Angle |
|---|---|---|---|
| mwl | Muslim World League | 18° | 17° |
| isna | Islamic Society of North America | 15° | 15° |
| egypt | Egyptian General Authority | 19.5° | 17.5° |
| makkah | Umm Al-Qura University | 18.5° | 90 min after Maghrib |
| karachi | University of Islamic Sciences, Karachi | 18° | 18° |
Supported Cities
Response Fields
prayers.fajr
Dawn prayer time (HH:MM, 24h, local)
prayers.sunrise
Sunrise time
prayers.dhuhr
Noon prayer time
prayers.asr
Afternoon prayer time (varies by school)
prayers.maghrib
Sunset prayer time
prayers.isha
Night prayer time
qibla.direction
Bearing to Kaaba in degrees (0°–360°)
qibla.compass
Compass direction (e.g., WSW, WNW)
Rate Limits
| Plan | Requests/Month | Rate Limit |
|---|---|---|
| Free | 1,000 | 20 req/min |
| Starter | 10,000 | 60 req/min |
| Professional | 100,000 | 300 req/min |
| Business | 500,000 | 500 req/min |
Debugging & Support
Include X-Request-ID when contacting support
Every response from KhaleejiAPI includes an X-Request-ID header — a unique identifier that lets our support team pull the exact log entry for your request within seconds. Always share it when reporting an unexpected error or unexpected result.
How to capture it
JavaScript / fetch
const res = await fetch("https://khaleejiapi.dev/api/v1/...", {
headers: { Authorization: "******" },
});
const requestId = res.headers.get("x-request-id");
console.log("Request ID:", requestId);
// → e.g. "req_01j9xkz4vp8..."cURL
curl -si "https://khaleejiapi.dev/api/v1/..." \ -H "Authorization: ******" | grep -i x-request-id # → x-request-id: req_01j9xkz4vp8...
Browser DevTools
Open DevTools (F12) → Network tab → click the failing request → scroll to the Response Headers section → copy the value next to x-request-id.
For a full list of error codes and guidance on common issues, see the Troubleshooting guide.