GlobalQuranBLOG Read the Quran

Developers ·

A prayer times API that matches local mosques: MuslimSalat

MuslimSalat.com, part of Global Quran, has served prayer times to apps, TV boxes and websites since 2012. Its API answers with the times people in each city actually pray by, because each place is set to the timetable its local authority or main mosque publishes, not to one generic formula. It is free, as JSON or as a calendar file.

The MuslimSalat prayer times API page: prayer times that match your local mosque, with an example JSON answer

Read the API docs Get your free key

Put a place in the address

GET /{location}.json
GET /{location}/{daily|weekly|monthly|yearly|ramadan}.json
GET /{location}/{times}/{dd-mm-yyyy}.json
GET /{location}/monthly.ics                  calendar (webcal:// to subscribe)
GET /daily.json                              place found from the caller's IP
GET /{location}/{monthly|ramadan}.pdf        printable calendar

For example https://muslimsalat.com/london.json?key=YOUR_KEY returns today's Fajr, sunrise (shurooq), Dhuhr, Asr, Maghrib and Isha for London, with the timetable it used (Regent's Park Mosque), the Qibla direction, the time zone and the Hijri date. These are the same addresses the API has always used, so apps built years ago keep working.

Parameters

NameWhat it does
keyYour API key, required for new apps and sites. Free.
methodA timetable by id (see /api/methods.json) or the old numbers 1 to 7. Leave it out to get the place's local timetable.
asrhanafi or shafi. Both Asr times are always in the answer (asr and asr_hanafi).
fajr, ishaYour own convention, for example fajr=18, isha=17 or isha=90min.
ramadanAdds imsak and iftar to every day (they are always there in Ramadan).
jsoncallbackJSONP wrapper.

Why the times are trusted

Every night the server compares its times with the published timetables of mosques and authorities around the world, day by day, and shows the result on the public accuracy map. Green means every time is within 2 minutes. The sun's position is calculated precisely, daylight saving is applied for every single day, and Hijri dates follow each country's rule. Read more in prayer times that match your mosque.

Also on MuslimSalat

  • Compass images: /qibla_compass/{size}/{degrees}.png (styles classic, astrolabe, enamel, silver) or an animated .svg. See the Qibla compass for your site.
  • Printable calendars: monthly and Ramadan PDFs in four designs (astrolabe, illuminated, night, wall), A4 or Letter.
  • A ready-made widget, if you don't want to write code: prayer times on your website.

Keys and limits

A key is free: sign in and copy it at docs.globalquran.com, the same account as the Quran API. Apps and sites that used MuslimSalat before keep working without one. Use is fair-use, and the limits belong to your key.

Keep reading