Prayer times for any place and date (up to 31 days): imsak, fajr, sunrise, dhuhr, asr, sunset, maghrib, isha and midnight in local time, with the Hijri date. Computed with the chosen method's published angles (default: the method used in the place's country), Standard or Hanafi Asr, and a high-latitude rule.
Every response includes credits_used: the credits this call cost.
Parameters
name
type
description
lat
number
Latitude. Pass with lon; or use q, postal_code or geonameid.
lon
number
Longitude.
q
string
Place name, optionally with region and country: Cairo, Birmingham, GB. Example: Cairo
postal_code
string
Postal code, with country (default US).
country
string
Country for q or postal_code (ISO code or English name).
geonameid
integer
GeoNames id of a place (from /geo/v1/cities).
date
string
First date (YYYY-MM-DD, default today).
days
integer
Days, 1-31 (default 1).
method
mwl | isna | egypt | makkah | karachi | tehran | jafari | gulf | kuwait | qatar | dubai | singapore | jakim | kemenag | turkey | france | russia | tunisia | algeria | morocco | jordan
Calculation method (default by country, else MWL).
school
standard | hanafi
Asr: standard (Shafi, Maliki, Hanbali) or hanafi (default by country).
high_latitude
angle_based | night_middle | one_seventh | none
Rule where twilight never ends: angle_based (default), night_middle, one_seventh, none.
import os, requests
res = requests.get(
"https://api.api.sh/calendar/v1/prayer-times",
params={},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json()
const url = new URL("https://api.api.sh/calendar/v1/prayer-times");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json();
Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).
The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.