📄API Documentation
Generate ICS calendar feeds for prayer times using a simple HTTP GET endpoint.
Endpoint
GET /api/prayer-times.ics?address=...&method=...Returns an text/calendar ICS file. Subscribe to the URL in any calendar app (Google Calendar, Apple Calendar, Outlook) for auto-updating prayer times.
Parameters
* Provide either address or both latitude+longitude.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
address | string | Yes* | — | City or address to geocode (e.g. "Cairo, Egypt"). Provide either address OR latitude+longitude. |
latitude | number | Yes* | — | Latitude in decimal degrees. |
longitude | number | Yes* | — | Longitude in decimal degrees. |
method | number | No | 5 | Calculation method ID from AlAdhan API (e.g. 1=University of Islamic Sciences Karachi, 2=ISNA, 3=MWL, 4=Umm al-Qura, 5=Egyptian General Authority). |
duration | number | No | 25 | Event duration in minutes. |
months | number | No | 3 | Number of months to generate (1-11). |
alarm | string | No | 5 | Comma-separated alarm offsets in minutes before the event (e.g. "5,10,15"). |
events | string | No | all | Comma-separated indices of prayer events to include (0=Fajr, 1=Sunrise, 2=Dhuhr, 3=Asr, 4=Maghrib, 5=Isha, 6=Midnight). Omit to include all. |
lang | string | No | en | Language for event names and descriptions ("en" or "ar"). |
color | string | No | — | CSS color for calendar events (e.g. "#1e90ff"). URL-encode the # as %23. |
traveler | boolean | No | false | Enable travel/Qasr mode. Shortens 4-rak'at prayers to 2 rak'at with a note in the description. |
jumuah | boolean | No | false | Add a Jumu'ah (Friday prayer) event replacing Dhuhr on Fridays. |
jumuahDuration | number | No | 60 | Duration of the Jumu'ah event in minutes. Only used when jumuah=true. |
qibla | boolean | No | false | Include Qibla direction (bearing and compass) in event descriptions. |
dua | boolean | No | false | Include a rotating Du'a/Adhkar from Hisn al-Muslim in event descriptions. |
iqama | string | No | — | Comma-separated iqama offsets in minutes for each prayer (Fajr,Sunrise,Dhuhr,Asr,Maghrib,Isha,Midnight). Creates separate "Iqama" events. Max 60 per prayer. |
ramadanMode | boolean | No | false | Add Iftar, Taraweeh, and Suhoor events during Ramadan days. |
iftarDuration | number | No | 30 | Duration of Iftar event in minutes. Only used when ramadanMode=true. |
traweehDuration | number | No | 60 | Duration of Taraweeh event in minutes. Only used when ramadanMode=true. |
suhoorDuration | number | No | 30 | Duration of Suhoor event in minutes. Only used when ramadanMode=true. |
hijri | string | No | desc | Where to display the Hijri date: "title" (in event title), "desc" (in description), "both", or "none". |
hijriHolidays | boolean | No | false | Include Islamic holidays (Eid, etc.) in the event description when applicable. |
Examples
Basic — Cairo, 3 months
/api/prayer-times.ics?address=Cairo%2C%20Egypt&method=5Coordinates with custom alarms
/api/prayer-times.ics?latitude=30.0444&longitude=31.2357&method=5&alarm=5,10&duration=30Arabic + Qibla + Du'a
/api/prayer-times.ics?address=Mecca&method=4&lang=ar&qibla=true&dua=trueTravel mode with Iqama offsets
/api/prayer-times.ics?address=London&method=2&traveler=true&iqama=15,0,10,10,5,10,0Ramadan + Jumu'ah + color
/api/prayer-times.ics?address=Istanbul&method=13&ramadanMode=true&jumuah=true&color=%231e90ffJSON API
Get today's prayer times as JSON. Useful for webhooks, IFTTT, Home Assistant, or custom integrations.
GET /api/prayer-times.json?address=...&method=...Accepts the same location and method parameters as the ICS endpoint. Additional options:
qibla=true— include Qibla directionlang=ar— Arabic outputformat=webhook— detailed timings with ISO timestamps, Unix timestamps, and server timeformat=slack— pre-formatted Slack Block Kit messageformat=discord— pre-formatted Discord embed message
Example response:
{
"date": {
"gregorian": "03-02-2026",
"hijri": { "day": "15", "month": { "number": 8, "en": "Shaʿbān", "ar": "شَعْبَان" }, "year": "1447" }
},
"location": { "latitude": 30.0444, "longitude": 31.2357, "timezone": "Africa/Cairo", "address": "Cairo, Egypt" },
"method": "5",
"timings": {
"Fajr": "05:23", "Sunrise": "06:50", "Dhuhr": "12:12",
"Asr": "15:17", "Maghrib": "17:34", "Isha": "18:53", "Midnight": "23:42"
},
"nextPrayer": {
"name": "Dhuhr", "time": "12:12",
"iso": "2026-02-03T12:12:00.000Z", "timestamp": 1770120720, "minutesUntil": 45
}
}CORS is enabled. Responses are cached for 1 hour.
Integrations
🏠
Home Assistant
RESTful sensors & automations
🔗
IFTTT / Zapier
Coming soon
Rate Limits & Caching
- Responses are cached for up to 24 hours (shorter near midnight for fresh data).
- The underlying AlAdhan API is called once per unique location+method per month and cached server-side.
- There are no strict rate limits, but please be reasonable. Calendar apps typically poll once every few hours.
- For high-traffic integrations, contact us first.