Skip to content

Prayer Time

Accurate prayer times for any location with timezone-aware local time. Supports choice of calculation method, madhab, and date.

Get Prayer Times

GET/api/v1/prayer-time

Returns prayer time calculations for the given coordinates.


Query Parameters

ParameterTypeDescription
lat*floatLatitude in decimal degrees. Example: 24.7136.
lon*floatLongitude in decimal degrees. Example: 46.6753. You may also use lng.
methodstringCalculation method. Defaults to karachi. Supported values: mwl, makkah, cairo, tehran, isna, singapore, turkey, qatar, kuwait, dubai, moonsightingcommittee, other.
schoolstringMadhab for Asr calculation. Defaults to shafi. Supported values: shafi, hanafi.
datestringDate in YYYY-MM-DD or ISO format. Defaults to today.

Try Prayer Time API

Try Prayer Time API

Use your API key to send a live prayer-time request from the docs.

Latitude in decimal degrees.
Longitude in decimal degrees.
Optional calculation method.
Optional madhab (shafi or hanafi).
Optional date in YYYY-MM-DD format.
Used as the api_key query parameter.
GET /api/v1/prayer-time?lat=LATITUDE&lon=LONGITUDE&method=METHOD&school=SHAFI&date=YYYY-MM-DD&api_key=YOUR_KEY

Example Request

bash
curl "https://your-domain.com/api/v1/prayer-time?lat=24.7136&lon=46.6753&method=karachi&school=hanafi&date=2026-05-10&api_key=YOUR_KEY"
javascript
const response = await fetch('https://your-domain.com/api/v1/prayer-time?lat=24.7136&lon=46.6753&method=karachi&school=hanafi&date=2026-05-10', {
  headers: { 'X-API-Key': 'YOUR_KEY' }
});
const data = await response.json();
console.log(data);
python
import requests

response = requests.get(
    'https://your-domain.com/api/v1/prayer-time',
    params={
        'lat': 24.7136,
        'lon': 46.6753,
        'method': 'karachi',
        'school': 'hanafi',
        'date': '2026-05-10'
    },
    headers={'X-API-Key': 'YOUR_KEY'}
)
print(response.json())

Example Response

json
{
  "api_key": "YOUR_KEY",
  "request": {
    "lat": 24.7136,
    "lon": 46.6753,
    "method": "Karachi",
    "school": "hanafi",
    "date": "2026-05-10"
  },
  "timezone": "Asia/Riyadh",
  "times": {
    "fajr": {
      "utc": "2026-05-10T02:15:00.000Z",
      "local": "2026-05-10T05:15:00"
    },
    "sunrise": {
      "utc": "2026-05-10T04:30:00.000Z",
      "local": "2026-05-10T07:30:00"
    },
    "dhuhr": {
      "utc": "2026-05-10T10:00:00.000Z",
      "local": "2026-05-10T13:00:00"
    },
    "asr": {
      "utc": "2026-05-10T13:30:00.000Z",
      "local": "2026-05-10T16:30:00"
    },
    "maghrib": {
      "utc": "2026-05-10T15:45:00.000Z",
      "local": "2026-05-10T18:45:00"
    },
    "isha": {
      "utc": "2026-05-10T17:00:00.000Z",
      "local": "2026-05-10T20:00:00"
    }
  }
}

Response Fields

FieldTypeDescription
api_keystringThe API key used for the request
requestobjectThe normalized request payload
request.latnumberRequested latitude
request.lonnumberRequested longitude
request.methodstringActive calculation method
request.schoolstringActive madhab
request.datestringRequested date
timezonestringTimezone calculated from coordinates
timesobjectPrayer times for the date and location
times.*.utcstringPrayer time in UTC ISO format
times.*.localstringPrayer time in local timezone ISO format

Error Responses

Invalid coordinates — 400 Bad Request

json
{
  "error": "lat and lon must be valid numeric coordinates"
}

Missing or invalid API key — 401 Unauthorized

json
{
  "success": false,
  "error": "Unauthorized",
  "message": "Invalid or missing API key."
}

Free & Open Source Islamic API