Open source · MPL-2.0 · TypeScript, Python, Swift, Kotlin, Dart
Prayer times that match the timetable mosques follow
Mihrab Methods reproduces the published methods of recognised Islamic authorities — a ministry's, a muftiate's, a council of scholars' — and checks every result against the timetable that authority publishes. Fajr, sunrise, Dhuhr, Asr, Maghrib and Isha, calculated offline on the device.
npm install mihrab-methodspip install mihrab-methodsimport { nearestPlace, timesFor } from 'mihrab-methods';
// Istanbul, by Diyanet's method
const { place } = nearestPlace('diyanet', 41.01, 28.98)!;
const day = timesFor(place, '2026-10-15');
day.times!.fajr.printed; // 'HH:MM', as printed
day.status; // 'certified'
Every method is compared with its authority's published timetable and is used only at zero times off. What exactly was tested.
Why Mihrab Methods
A general prayer time calculator gives you an angle convention — Muslim World League, ISNA, Umm al-Qura — and lands a minute or a few away from the timetable a country's mosques actually follow.
Authority-specific
Each method is one authority's own: its angles, margins, rounding and reference points, not a generic convention with an offset.
Verified to the minute
Compared day by day with the published timetable. The record is public and regenerated on every change.
Offline
The times are calculated on the device. Nothing is fetched and no request is made per reader.
Made for app developers
TypeScript types, one import per authority and a clear status on every answer — the same methods in Python, Swift, Kotlin and Dart.
A free HTTP API
The same methods over HTTP, free, with no key. Or run the handler yourself, or skip the network entirely.
A plain fallback
For a place no authority publishes for, a plainly labelled standard calculation: MWL, ISNA, Egypt, Karachi, Umm al-Qura, either Asr.
Guides
Start with the one closest to what you are building.
JavaScript library
TypeScript and JavaScript: Node, the browser, React Native.
Read →Prayer time API
Calling prayer times over HTTP: routes, parameters, answers, limits.
Read →Mobile integration
React Native, Flutter, Swift and Kotlin: what to bundle, picking the place, scheduling.
Read →Working offline
Mobile apps that must work with no connection.
Read →Calculation methods
Which authority, which convention, which Asr.
Read →Examples
TypeScript, React Native, Flutter, Kotlin, Swift, Python.
Read →Diyanet
Reproducing Diyanet's times, in Türkiye and worldwide.
Read →Prayer times in Sweden
The tables Swedish mosques follow, and the summer nights.
Read →Compared with Adhan JS and AlAdhan
What each is for, what differs, and what this does not do.
Read →Reference
- Using the library and the API — every call, entry point and route
- OpenAPI description of the HTTP API (OpenAPI 3.1)
- Each method in words and formulas, for ports to other languages
- Where each method stands — what is certified, what was set aside
- The correction lists as a feed — keeping an installed app current
- Why this can be used freely
Built for
Muslim prayer apps, adhan and prayer notification apps, mosque timetable screens and websites, Islamic calendar apps and any product that shows people when to pray.
The Mihrab app computes its prayer times with this library. Mihrab Methods is independent of every authority whose method it reproduces.