# Prayer & Calendar: Free prayer times API, no API key needed

Source: https://qurangallery.com/docs/prayer/prayer-times-api

> Free prayer times API with no key or signup. Get daily times as JSON by latitude and longitude, plus an iCal feed, city search and nearby mosques.

The prayer times API at [qurangallery.com/prayer/developers](https://qurangallery.com/prayer/developers) is free and needs no API key or signup. Four public endpoints return daily prayer times as JSON for a latitude and longitude, a subscribable iCal feed, city search and nearby mosques.

Every endpoint lives under `https://qurangallery.com/prayer`. Bad input returns 400 and too many requests return 429.

## Prayer times for a location

`GET /api/times` returns 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.

```bash
curl 'https://qurangallery.com/prayer/api/times?lat=21.4225&lng=39.8262'
```

Parameters:

- `lat` — required. Latitude in decimal degrees.
- `lng` — required. Longitude in decimal degrees.
- `method` — optional. Calculation method id, for example mwl, isna or karachi. Default: the method of the nearest city.
- `asr` — optional. standard or hanafi, 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` and `ia` — optional. Custom Fajr and Isha angle in degrees, from 10 to 25. Default: the method's own angle.

The response, trimmed:

```json
{
  "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"
}
```

The date is the coordinates' own local day. Prayer times are not limited separately, so cache each location's answer for the day instead of calling on every page view.

## City search

`GET /api/location/search` turns a place name into coordinates, a country code and a time zone. It searches the app's own city list first, and a query with no match returns an empty array.

```bash
curl 'https://qurangallery.com/prayer/api/location/search?q=Makkah'
```

- `q` — required. The place name, up to 200 characters.

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

Take `lat` and `lon` of the first result and pass them as `lat` and `lng` to the prayer times endpoint.

## Calendar feed (iCal)

`GET /api/calendar/feed.ics` returns a subscribable `text/calendar` file with prayer times and Islamic events, one month by default and up to 12 months. Add its URL as a calendar subscription in Google Calendar, Apple Calendar or Outlook.

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

Required: `lat` and `lng`. Optional: `method`, `asr`, `hlr`, `fa`, `ia` as above, plus:

- `authority` — Hijri calendar authority for the events, for example umm_al_qura or diyanet. Default: the authority of the nearest city's country.
- `months` — months the feed covers, from 1 to 12. Default: 1.
- `alarm` — minutes before each prayer for the reminder, from 0 to 120. 0 means no alarm. Default: 10.
- `sunrise`, `travel`, `ramadan`, `jumuah`, `busy` — set to 1 to turn on sunrise, the travel note, Ramadan events, Jumu'ah on Fridays, or busy time. Default: off.

You can also build the same feed without code on the [calendar sync](https://qurangallery.com/docs/prayer/calendar-sync) page. The calendar feed allows 30 requests per minute.

## Nearby mosques

`GET /api/mosques/nearby` lists 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.

```bash
curl 'https://qurangallery.com/prayer/api/mosques/nearby?lat=21.4225&lng=39.8262&radius=2000'
```

- `lat` and `lng` — required.
- `radius` — optional. Search radius in metres, from 100 to 50000. Default: 2000.

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

Coverage depends on OpenStreetMap. The in-app view of the same data is described on the [mosques page](https://qurangallery.com/docs/prayer/mosques).

## 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.
- Calendar feed: 30 requests per minute.
- City search and nearby mosques share one allowance: 30 requests per minute.

## Using it from a browser

The API sends no CORS headers, so a page on another site cannot read the response. Call it from your server instead. If you only want to show the times on a website, use the [website widget](https://qurangallery.com/docs/prayer/website-widget): one iframe, no code and no key.

## See also

- [Website widget](https://qurangallery.com/docs/prayer/website-widget) — prayer times or a Hijri calendar as an iframe.
- [Calculation methods](https://qurangallery.com/docs/prayer/calculation-methods) — what the default method is, and the other options.
- [Calendar sync](https://qurangallery.com/docs/prayer/calendar-sync) — the same feed, built from a form.

## Next steps

- [Open Prayer times API](https://qurangallery.com/prayer/developers)
- [Prayer times for any city: free, 37 methods](https://qurangallery.com/docs/prayer/prayer-times)
- [Free prayer times widget for your mosque website](https://qurangallery.com/docs/prayer/website-widget)
- [Prayer documentation](https://qurangallery.com/docs/prayer)
