PrayerTimes APIprayertimes.com ↗
Get daily Islamic prayer times (Fajr, Dhuhr, Asr, Maghrib, Isha) for thousands of cities worldwide, plus Iftar/Imsak timings and Hijri calendar dates.
What is the PrayerTimes API?
The PrayerTimes.com API covers 4 endpoints that return today's Islamic prayer times — Fajr, Sunrise, Dhuhr, Asr, Maghrib, and Isha — for thousands of cities across all supported countries. The get_city_prayer_times endpoint delivers HH:MM-formatted times alongside Iftar and Imsak windows and three calendar representations (Gregorian, Hijri, and Rumi) in a single response. Two discovery endpoints let you enumerate countries and cities before making a prayer-times request.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/2729bffb-c871-4f4d-a639-abb313cca953/list_countries' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace prayertimes-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.global_prayer_times_api import PrayerTimes, Letter
client = PrayerTimes()
# List all supported countries
for country in client.countries.list():
print(country.name, country.slug)
# Get cities for a specific country using constructible navigation
turkey = client.country("turkey")
for city in turkey.cities.list():
print(city.name, city.slug)
# Get prayer times for a specific city
times = client.prayertimes.get(country="uk", city="london")
print(times.prayer_times.fajr, times.prayer_times.maghrib)
print(times.date_info.gregorian, times.date_info.hijri)
print(times.iftar_imsak.imsak, times.iftar_imsak.iftar)
# Browse cities alphabetically using the Letter enum
for city in client.cities.list_alphabetical(letter=Letter.M):
print(city.name, city.country_slug)
Retrieve the complete list of countries and regions supported by prayertimes.com. Returns an array of country objects with name, slug, and URL. Use country slugs as input to get_country_cities.
No input parameters required.
{
"type": "object",
"fields": {
"countries": "array of country objects with name, slug, and url"
},
"sample": {
"data": {
"countries": [
{
"url": "https://www.prayertimes.com/turkey/prayer-times.html",
"name": "Türkiye",
"slug": "turkey"
},
{
"url": "https://www.prayertimes.com/afghanistan/prayer-times.html",
"name": "Afghanistan",
"slug": "afghanistan"
},
{
"url": "https://www.prayertimes.com/uk/prayer-times.html",
"name": "UK",
"slug": "uk"
}
]
},
"status": "success"
}
}About the PrayerTimes API
What the API Returns
The core endpoint, get_city_prayer_times, accepts a city slug and a country slug and returns a prayer_times object with six named keys — Fajr, Sunrise, Dhuhr, Asr, Maghrib, Isha — each as an HH:MM string. The same response includes a date_info object carrying gregorian, hijri, and rumi date strings for the current day, and an iftar_imsak object with imsak and iftar time strings derived from Fajr and Maghrib respectively.
Discovery Endpoints
Before querying prayer times you need valid slugs. list_countries returns the full array of supported country objects, each with name, slug, and url fields. Pass a country slug into get_country_cities to receive every city available for that country, along with that day's date_info. Alternatively, get_cities_alphabetical lets you browse the global city list filtered by a single uppercase letter (A–Z); each city object includes both city_slug and country_slug, so you can feed them directly into get_city_prayer_times without a separate country lookup. Omitting the letter parameter returns the full global city list.
Calendar and Timing Details
Every response that includes date_info exposes all three calendar systems simultaneously — Gregorian, Hijri (Islamic lunar), and Rumi (Ottoman fiscal calendar). This makes it straightforward to display Islamic dates alongside standard dates without a separate calendar conversion step. Times are local to the requested city; the API does not return UTC offsets or timezone identifiers alongside the times.
The PrayerTimes API is a managed, monitored endpoint for prayertimes.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when prayertimes.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official prayertimes.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Display daily prayer schedule widgets in a Muslim-focused mobile app using
get_city_prayer_timeswith the user's detected city slug. - Build a Ramadan companion app that surfaces Imsak and Iftar times from the
iftar_imsakresponse object. - Populate a city-selector dropdown by fetching available cities with
get_country_citiesfor a user-chosen country. - Show the current Hijri date alongside prayer times by reading the
hijrifield fromdate_infoin any response. - Index the full global city coverage by iterating
get_cities_alphabeticalacross all 26 letters to collect everycity_slug/country_slugpair. - Send automated prayer-time reminders by polling
get_city_prayer_timesonce per day per subscribed city and comparing current time to each prayer field. - Support multi-country Islamic scheduling tools by using
list_countriesto enumerate all regions and then resolving cities per country.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does prayertimes.com offer an official developer API?+
What does `get_city_prayer_times` return beyond the six prayer times?+
prayer_times object (Fajr, Sunrise, Dhuhr, Asr, Maghrib, Isha), the response includes an iftar_imsak object with imsak and iftar times, a date_info object with Gregorian, Hijri, and Rumi date strings, and a location object confirming the country and city slugs used.Can I retrieve prayer times for a future or past date?+
date parameter for historical or future lookups. You can fork this API on Parse and revise it to add a date parameter if you need multi-day scheduling data.Do prayer time responses include timezone or UTC offset information?+
How do I find the correct slug for a city like Istanbul or London?+
get_country_cities with the appropriate country slug (e.g. turkey or uk) to retrieve the full city list for that country, each with a slug field. Alternatively, call get_cities_alphabetical with letter=I or letter=L to find cities globally by their first character; each result includes both city_slug and country_slug.