Skip to content

Quran Gallery Developers

Free Prayer Times API: No Key Needed

Four public endpoints return prayer times as JSON, a calendar feed, city search and nearby mosques. No account, no API key, no charge.

No API keyJSON and iCalFree to use

Base URL

https://qurangallery.com/prayer

Every endpoint below lives under this address. Bad input returns 400 and too many requests return 429. The API sends no CORS headers, so call it from your server rather than from a browser page on another site.

Prayer times for a location

GET /prayer/api/times

Today's Fajr, sunrise, Dhuhr, Asr, Maghrib and Isha for a pair of coordinates, plus tomorrow's Fajr. Every time is an ISO 8601 instant in UTC. A time that does not exist at that latitude on that day is left out.

Parameters

lat required
Latitude in decimal degrees.
lng required
Longitude in decimal degrees.
method optional
Calculation method id, for example muslim-world-league, north-america or karachi. Default: the method of the nearest city.
madhab optional
Hanafi or Shafi, which sets the Asr time. Default: the usual convention of the nearest city's country.
hlr optional
High-latitude rule: auto, middle-of-the-night, seventh-of-the-night or twilight-angle. Default: auto.
fa optional
Custom Fajr angle in degrees, from 10 to 25. Default: the method's own angle.
ia optional
Custom Isha angle in degrees, from 10 to 25. Default: the method's own angle.

Example

curl
curl 'https://qurangallery.com/prayer/api/times?lat=21.4225&lng=39.8262'
fetch
const res = await fetch('https://qurangallery.com/prayer/api/times?lat=21.4225&lng=39.8262');
const { date, times, fajrTomorrow } = await res.json();

Response

{
  "date": "2026-10-31",
  "times": [
    { "name": "fajr", "time": "2026-10-31T02:06:00.000Z", "isCurrent": false, "isNext": true },
    { "name": "sunrise", "time": "2026-10-31T03:23:00.000Z", "isCurrent": false, "isNext": false },
    { "name": "dhuhr", "time": "2026-10-31T09:04:00.000Z", "isCurrent": false, "isNext": false },
    { "name": "asr", "time": "2026-10-31T12:20:00.000Z", "isCurrent": false, "isNext": false },
    { "name": "maghrib", "time": "2026-10-31T14:45:00.000Z", "isCurrent": false, "isNext": false },
    { "name": "isha", "time": "2026-10-31T16:15:00.000Z", "isCurrent": false, "isNext": false }
  ],
  "fajrTomorrow": "2026-11-01T02:06:00.000Z"
}

Calendar feed (iCal)

GET /prayer/api/calendar/feed.ics

A subscribable .ics feed with prayer times and Islamic events for the next month by default, and up to 12 months with the months parameter. Add the URL as a calendar subscription in Google Calendar, Apple Calendar or Outlook.

Parameters

lat required
Latitude in decimal degrees.
lng required
Longitude in decimal degrees.
method optional
Calculation method id, for example muslim-world-league, north-america or karachi. Default: the method of the nearest city.
madhab optional
Hanafi or Shafi, which sets the Asr time. Default: the usual convention of the nearest city's country.
authority optional
Hijri calendar authority for the events, for example umm_al_qura or diyanet. Default: the authority of the nearest city's country.
months optional
Months the feed covers, from 1 to 12. Default: 1.
alarm optional
Minutes before each prayer to sound the reminder, from 0 to 120. 0 means no alarm. Default: 10.
a_<prayer> optional
Alarm minutes for one prayer, from 0 to 120, replacing alarm. Use fajr, dhuhr, asr, maghrib or isha in place of <prayer>, as in a_fajr=15.
o_<prayer> optional
Shift one prayer by this many minutes, from -60 to 60. Use fajr, dhuhr, asr, maghrib or isha in place of <prayer>, as in o_isha=5. Default: 0.
sunrise optional
Set to 1 to add sunrise to the feed. Default: off.
travel optional
Set to 1 to note on Dhuhr, Asr and Isha that the prayer is shortened to 2 rakahs when travelling. Default: off.
ramadan optional
Set to 1 to add Suhoor ends (at Fajr), Iftar (at Maghrib) and Tarawih (starting 15 minutes after Isha, one hour long) on the days of Ramadan. Days follow the authority parameter. Default: off.
jumuah optional
Set to 1 to title the Dhuhr event “Jumu'ah” on Fridays. Default: off.
jumuahLead optional
Minutes before Jumu'ah for its reminder, from 0 to 120; 0 means none. Replaces the Dhuhr reminder on Fridays and needs jumuah=1. Default: the Dhuhr reminder.
busy optional
Set to 1 to mark the prayer events as busy (TRANSP:OPAQUE). Default: free (TRANSP:TRANSPARENT).
hlr optional
High-latitude rule: auto, middle-of-the-night, seventh-of-the-night or twilight-angle. Default: auto.
fa optional
Custom Fajr angle in degrees, from 10 to 25. Default: the method's own angle.
ia optional
Custom Isha angle in degrees, from 10 to 25. Default: the method's own angle.

Example

curl
curl 'https://qurangallery.com/prayer/api/calendar/feed.ics?lat=21.4225&lng=39.8262'

Response

A text/calendar (iCalendar) document with one month of events by default, up to 12 months with months.

GET /prayer/api/location/search

Turns a place name into coordinates, a country code and a time zone. It searches our own city list first. A query with no match returns an empty array.

Parameters

q required
The place name, up to 200 characters.

Example

curl
curl 'https://qurangallery.com/prayer/api/location/search?q=Makkah'
fetch
const res = await fetch('https://qurangallery.com/prayer/api/location/search?q=Makkah');
const places = await res.json();

Response

[
  {
    "lat": 21.4266,
    "lon": 39.8256,
    "displayName": "Makkah, Saudi Arabia",
    "countryCode": "SA",
    "timezone": "Asia/Riyadh"
  }
]

Nearby mosques

GET /prayer/api/mosques/nearby

Mosques around a point, nearest first, from OpenStreetMap data. The distance is in metres. The answer is 503 when the map data services are unavailable.

Parameters

lat required
Latitude in decimal degrees.
lng required
Longitude in decimal degrees.
radius optional
Search radius in metres, from 100 to 50000. Default: 2000.

Example

curl
curl 'https://qurangallery.com/prayer/api/mosques/nearby?lat=21.4225&lng=39.8262&radius=2000'
fetch
const res = await fetch('https://qurangallery.com/prayer/api/mosques/nearby?lat=21.4225&lng=39.8262&radius=2000');
const mosques = await res.json();

Response

[
  {
    "id": 1234567,
    "name": "Example Mosque",
    "lat": 21.4231,
    "lng": 39.8269,
    "address": "Example Street 12",
    "distance": 96.4
  }
]

Rate limits

Limits count requests per IP address in a one-minute window. Past the limit you get HTTP 429.

  • Prayer times: no limit of its own. Cache each location's answer for the day instead of calling it on every page view.
  • Calendar feed: 30 requests per minute.
  • City search and nearby mosques share one allowance: 30 requests per minute.

Frequently Asked Questions

Is the prayer times API free, and do I need an API key?

Yes, it is free and needs no key, no account and no sign-up. Send a GET request to the endpoint with the parameters above. Please stay inside the rate limits and cache the results.

How do I get prayer times for a city name?

Call the city search endpoint with q, take the lat and lon of the first result, then pass them as lat and lng to the prayer times endpoint.

Which calculation method and Asr rule does the API use by default?

If you send no method, it uses the method of the city nearest to your coordinates. If you send no madhab, it uses the usual Asr convention of that city's country. Send method and madhab to fix both.

Why is a prayer missing from the response?

Near the poles in summer or winter the sun may never reach the Fajr or Isha angle, so there is no time to give. The API leaves that prayer out instead of returning an invalid date.

Can I call the API from JavaScript in the browser?

The API sends no CORS headers, so a page on another site cannot read the response. Call it from your server, or use the embeddable widget, which needs no code.

How often should I request prayer times?

Once per location per day is enough. Store the response and compute countdowns in your own code. Tomorrow's Fajr is included for the hours after Isha.

How do I add prayer times to a calendar app?

Subscribe to the calendar feed URL with your coordinates. Google, Apple and Outlook calendars refresh it on their own schedule, and it covers the next 30 days.

Developers

No code? Embed the widget

Paste a single iframe to show a city's prayer times or a month calendar on your site, in 7 languages. No key needed either.