API Reference

NOUS Prayer Times API

One deterministic service for Islamic timekeeping: prayer times, Qibla, Hijri dates, and crescent data. Every route is a plain GET that returns flat JSON. This page is a usage reference — how to call it and what comes back.

Base URL & authentication

All endpoints live under /v1 on your issued host. Every call carries your key in an X-API-Key header, sent server-side — never embed a key in client-side code. Keys are issued on onboarding: write to prayer@kairoico.com for an evaluation key.

# key sent server-side, never in the browser curl -s "https://YOUR_HOST/v1/sun/prayer?year=2026&month=8&day=9&lat=21.4225&lon=39.8262&method=makkah" \ -H "X-API-Key: YOUR_KEY"

Response shape

Every reply is a flat JSON object: ok (boolean), fields (the named result values), and raw (the same values as a single line, handy for logs). Times are HH:MM:SS in the location's own civil clock, with the timezone reported for audit.

{ "ok": true, "fields": { /* named values — see each endpoint below */ }, "raw": "OK ..." }

Endpoints

GET/v1/sun/prayer

The daily prayer times for a date and place. Returns imsak, fajr, sunrise, dhuhr, asr, maghrib, isha, midnight and the night thirds, plus the angles used, the Hijri date, and the Qibla bearing — all in one call.

ParameterReqDescription
year, month, dayyesGregorian date.
lat, lonyesDecimal degrees, north/east positive.
methodnoCalculation convention (default MWL). See the methods table.
asrno1 = Shāfiʿī (default), 2 = Hanafī.
shafaqnogeneral | ahmer | abyad (Moonsighting method).
midnightnosunni | shia.
highlatnoHigh-latitude convention. See the high-latitude table.
imsaknoMinutes before fajr for imsak (default 10).
elevnoObserver elevation in metres (horizon-dip correction).
tznoSeconds east of UTC to force an offset; default resolves the location's zone.
fajr_angle, isha_angle,
maghrib_angle, isha_interval
noOverride the convention's angles/interval with custom values.
roundnoup | down | nearest | none for the civil times.
parityno1 serves the published authority calendar verbatim on the civil times when one is on file for that method and year; the astronomical times always remain under exact. The reply is tagged "parity": "<authority>_<year>", or "parity": "unavailable" when no table is on file. Omitted when off.
# Makkah, Umm al-Qura GET /v1/sun/prayer?year=2026&month=8&day=9&lat=21.4225&lon=39.8262&method=makkah { "ok": true, "fields": { "date": "2026-08-09", "method": "UmmAlQura", "fajr_angle": 18.5, "asr_factor": 1, "imsak": "04:25:10", "fajr": "04:35:10", "sunrise": "05:56:54", "dhuhr": "12:26:14", "asr": "15:46:51", "maghrib": "18:55:18", "isha": "20:25:18", "midnight": "00:26:17", "tz": "Asia/Riyadh", "hijri": "1448-02-26", "qibla_bearing_deg": 0.0 } }

GET/v1/sun/prayer/month

A full month (or any day-span) of prayer times for a place in one call — the same per-day maths as the daily route, DST-aware. Accepts every option the daily route does.

ParameterReqDescription
year, monthyesMonth to render.
day, n_daysnoOptional start day and length; defaults to the whole month.
lat, lonyesDecimal degrees.
method, asr, highlat, …noSame options as /v1/sun/prayer.
GET /v1/sun/prayer/month?year=2026&month=8&lat=21.4225&lon=39.8262 # one row per day: date, imsak, fajr, sunrise, dhuhr, asr, maghrib, isha, hijri

GET/v1/qibla

Initial great-circle bearing and distance to the Kaaba from any location. Also rides along inside every prayer reply.

ParameterReqDescription
lat, lonyesDecimal degrees.
GET /v1/qibla?lat=59.9139&lon=10.7522 { "ok": true, "fields": { "qibla_bearing_deg": 139.0278, "qibla_distance_km": 4848.481, "kaaba_lat": 21.4225, "kaaba_lon": 39.8262 } }

GET/v1/date/hijri

Convert a Gregorian date to the Hijri calendar date, with the anchoring new-moon exposed.

ParameterReqDescription
year, month, dayyesGregorian date.
GET /v1/date/hijri?year=2026&month=8&day=9 { "ok": true, "fields": { "hijri": "1448-02-26", "month": "Safar", "convention": "day_after_conjunction" } }

GET/v1/moon/phase

Moon phase, elongation, and illumination for any moment — the raw ingredients behind sighting the crescent that starts Ramadan and Eid.

ParameterReqDescription
year, month, dayyesGregorian date.
hournoHour of day (UTC), default 0.
GET /v1/moon/phase?year=2026&month=8&day=9 { "ok": true, "fields": { "phase": "…", "elongation": "…", "illumination_pct": "…" } }

GET/v1/sun/subsolar

The point on Earth the sun is directly over. On the two days a year it stands over the Kaaba, anyone can find Qibla by their own shadow — no compass needed.

ParameterReqDescription
year, month, dayyesGregorian date.
hournoHour of day (UTC), default 0.
GET /v1/sun/subsolar?year=2026&month=8&day=9&hour=12 { "ok": true, "fields": { "sub_lat_deg": "…", "sub_lon_deg": "…" } }

Reference tables

Calculation methods (method=)

TokenConvention
MWLMuslim World League
ISNAIslamic Society of North America
EgyptEgyptian General Authority of Survey
KarachiUniversity of Islamic Sciences, Karachi
UmmAlQura / MakkahUmm al-Qura University, Makkah
DubaiDubai (UAE)
QatarQatar
GulfGulf Region
KuwaitKuwait
SingaporeMajlis Ugama Islam Singapura
FranceUnion des Organisations Islamiques de France
TurkeyDiyanet İşleri Başkanlığı
RussiaSpiritual Administration of Muslims of Russia
TehranInstitute of Geophysics, University of Tehran
JafariShia Ithna Ashari (Jafari)
MoonsightingCommitteeMoonsighting Committee Worldwide (seasonal)

High-latitude conventions (highlat=)

TokenBehaviour when fajr/isha does not occur
noneReturn “does not occur” (default — honest).
middleMiddle of the night.
seventhOne-seventh of the night.
angleAngle-based proportion of the night.
nearest_dayCarry the clock time from the nearest day the prayer does occur.
nearest_latUse the nearest latitude at which the prayer occurs.

Other options

ParameterValues
asr1 Shāfiʿī · 2 Hanafī
shafaqgeneral · ahmer · abyad
midnightsunni · shia
roundup · down · nearest · none

Rate limits

Every plan carries a published ceiling. There are no hidden per-IP throttles and no silent degradation: you either get a 200 with a real computed answer, or a 429 that tells you the ceiling was reached. Nothing in between.

Each plan has three independent limits:

LimitWhat it means
sustainedRequests per second you can hold indefinitely. Unused capacity accrues up to the burst ceiling.
burstThe most requests that can be served in one instantaneous spike after an idle period — the adhan-moment allowance.
concurrentHow many of your requests may be in flight at the same instant. Your private slice, so no other customer's traffic can crowd you out — and yours cannot crowd out theirs.
PlanSustainedBurstConcurrent
Evaluation1 / s101
Starter5 / s104
Growth25 / s508
Scale75 / s15016

These ceilings apply to every route on this page; prayer times, Qibla, Hijri and crescent calls all draw on the same allowance, and none of them carries an extra per-route cap. A month call is one request against your limit, not thirty — fetching a whole month or a whole year through /v1/sun/prayer/month is the cheapest way to stay inside a plan.

On what these numbers are not: they are a fairness and billing pace. If your ceiling is the thing constraining you, that is a plan question and we can raise it.

Need a higher ceiling, a dedicated instance, or terms for an appliance or OEM programme? prayer@kairoico.com.

Errors

Errors return a JSON object with a numeric code and a human error string. Common cases:

CodeMeaning
400Missing or malformed parameter.
401Invalid or missing API key on a keyed request.
429Rate ceiling reached for your plan — see Rate limits.
{ "code": 400, "error": "missing parameter: lat" }

Need a higher tier, a dedicated instance, or appliance and OEM terms? prayer@kairoico.com.