Prayer times API
A free JSON API for prayer times in every city on this site. There is no API key, no sign-up and no rate limit — each endpoint is a static file on a CDN, returning today's times plus a 30-day timetable, the coordinates, the timezone and the calculation method with the authority behind it.
Quickstart
One GET request, no headers, no authentication. The shape is /api/{country}/{city}.json:
# today's prayer times for one city - no key, no headers
curl https://prayertime.info/api/turkey/istanbul.json Endpoints
Every city page has a matching JSON endpoint. CORS is open, so you can call these directly from a browser.
| Endpoint | Returns |
|---|---|
| /api/{country}/{city}.json | Today's times, 30-day table, coordinates, timezone and calculation method |
| /api/{country}/{capital}.json | The same shape for that country's capital |
| /openapi.json | OpenAPI 3.1 specification |
CORS is open and no authentication header is required.
Response fields
The response states not only the times but the convention that produced them, which is what makes it safe to display.
| Field | Example |
|---|---|
| city | "Istanbul" |
| slug | "istanbul" |
| country | "Turki" |
| country_slug | "turkey" |
| latitude | 41.0082 |
| longitude | 28.9784 |
| timezone | "Europe/Istanbul" |
| qibla_degrees_from_north | 151.6 |
| method | "Diyanet" |
| authority | "Presidensi Hal Ehwal Agama Turki" |
| madhab | "Syafi'i, Maliki dan Hanbali" |
| generated | "2026-10-10T08:33:48+03:00" |
| license | "CC BY 4.0 - free to use, please link back." |
| source | "https://prayertime.info/ms/turkey/" |
| fields | array[7] |
| days | array[30] |
Code samples
Fetching today's Maghrib for one city, in four languages.
// JavaScript - CORS is open, so this works from a browser
const r = await fetch('https://prayertime.info/api/turkey/istanbul.json');
const d = await r.json();
console.log(d.days[0].maghrib, d.method); // days[0] is today
# Python
import requests
d = requests.get('https://prayertime.info/api/turkey/istanbul.json').json()
print(d['days'][0]['maghrib'], d['method'])
# PHP
$d = json_decode(file_get_contents(
'https://prayertime.info/api/turkey/istanbul.json'), true);
echo $d['days'][0]['maghrib'], ' ', $d['method']; Calculation method parameters
Each endpoint reports the method applied for that country. The angles behind each method, the authority that publishes them and the document we cite are on the methodology page — if you need a convention other than a country's default, those parameters are what you would feed your own calculation.
Caching and fair use
Responses are static files behind a CDN, so they are cheap to serve, but prayer times only change once a day. Cache for 24 hours and you will be faster and we will stay free. Do not poll per page view.
Licence
CC BY 4.0. Use it commercially if you like. Two conditions: attribute prayertime.info with a link, and state the calculation method alongside the times, because a time without its method is ambiguous.
Cite this page
Copy this to cite this page:
Prayer Times. "Prayer times API". https://prayertime.info/en/developers/api/