Islamic Prayer Times API
Prayer times by country and city name, monthly and yearly calendars, next prayer, Qibla, Hijri dates, gold, weather and Quran. Clean JSON and docs built for developers and AI assistants alike.
Quick start in 30 seconds
One request is enough. No coordinates needed: country and city by name, method picked automatically.
https://wesalna.com/api/public/prayer-times?country=JO&city=ammancurl -s "https://wesalna.com/api/public/prayer-times?country=JO&city=amman"Building with AI? Paste this
Copy this prompt into ChatGPT, Claude, Cursor or Lovable and it will build the prayer times for you, attribution included.
Add live prayer times to my website using the free Wesalna API (no key, no signup).
Docs: https://wesalna.com/developers | OpenAPI: https://wesalna.com/openapi.json | Guide: https://wesalna.com/llms.txt
Endpoint: GET https://wesalna.com/api/public/prayer-times?country=<ISO code>&city=<city name>
Country list: https://wesalna.com/api/public/countries | Cities: https://wesalna.com/api/public/countries/{code}
Monthly table: https://wesalna.com/api/public/prayer-calendar?country=JO&city=amman&month=1
Countdown: https://wesalna.com/api/public/next-prayer?country=JO&city=amman
Requirements:
- Show fajr, sunrise, dhuhr, asr, maghrib and isha using times.<prayer>.local.
- Respect the response Cache-Control header: 5 minutes for current-year calendars without year, one year only with an explicit year. Refresh year-less calendars after expiry; update explicit year when displaying a new year.
- REQUIRED: render the attribution.html field from the response visibly next to the times, as a normal followable link to https://wesalna.com. Do not hide it or add nofollow.Prayer times
Prayer times
Precise astronomical prayer times for one day by country and city name (or coordinates), plus imsak, midnight, last third, the Hijri date and the Qibla bearing.
/api/public/prayer-timesLocation rule: Send at least one of: city, country, or lat together with lng.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
country | string | Optional | JO | ISO code or name such as JO or jordan. Alone it returns the capital; with city it disambiguates. List at /api/public/countries. |
city | string | Optional | amman | City name or slug in English or Arabic, such as amman or عمان, instead of coordinates. Sets timezone, method and Asr school automatically. |
lat | number | Optional | - | Between -90 and 90. Required unless city or country is sent. |
lng | number | Optional | - | Between -180 and 180. Required unless city or country is sent. |
date | date | Optional | - | Format YYYY-MM-DD, defaults to today. |
method | string | Optional | - | Optional. Defaults to the method used in the requested country, otherwise Muslim World League. |
madhhab | string | Optional | - | standard for the majority, hanafi for the Hanafi view. |
timezone | string | Optional | - | IANA identifier such as Asia/Amman for local times. |
Try it live
https://wesalna.com/api/public/prayer-times?country=JO&city=ammancurl -s "https://wesalna.com/api/public/prayer-times?country=JO&city=amman"Cache: 5 minutes for today, one year when date is given.
Monthly and yearly prayer calendar
A full month of prayer times, or a full year when month is omitted, by city, country or coordinates.
/api/public/prayer-calendarLocation rule: Send at least one of: city, country, or lat together with lng.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
country | string | Optional | JO | ISO code or name. Alone it returns the capital. |
city | string | Optional | amman | City name or slug, English or Arabic. |
lat | number | Optional | - | Alternative to city/country. |
lng | number | Optional | - | Alternative to city/country. |
timezone | string | Optional | - | Optional IANA identifier. |
year | number | Optional | - | Defaults to the current year. |
month | number | Optional | 1 | 1..12, empty for the whole year. |
Try it live
https://wesalna.com/api/public/prayer-calendar?country=JO&city=amman&month=1curl -s "https://wesalna.com/api/public/prayer-calendar?country=JO&city=amman&month=1"Cache: 5 minutes when year is omitted; one year when year is explicitly provided.
Next prayer
The upcoming prayer, its time and the seconds remaining, ideal for countdowns.
/api/public/next-prayerLocation rule: Send at least one of: city, country, or lat together with lng.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
country | string | Optional | JO | ISO code or name. Alone it returns the capital. |
city | string | Optional | amman | City name or slug, English or Arabic. |
lat | number | Optional | - | Alternative to city/country. |
lng | number | Optional | - | Alternative to city/country. |
timezone | string | Optional | - | Optional IANA identifier. |
Try it live
https://wesalna.com/api/public/next-prayer?country=JO&city=ammancurl -s "https://wesalna.com/api/public/next-prayer?country=JO&city=amman"Cache: 30 seconds.
Calculation methods
All supported calculation methods and Asr schools.
/api/public/methodsTry it live
https://wesalna.com/api/public/methodscurl -s "https://wesalna.com/api/public/methods"Cache: One day.
Places and Qibla
Supported countries
Every country with ISO code, flag, currency, timezone and the default calculation method and Asr school.
/api/public/countries| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
search | string | Optional | - | Country name or code. |
muslim | string | Optional | - | Send 1 to filter. |
arabic | string | Optional | - | Send 1 to filter. |
Try it live
https://wesalna.com/api/public/countriescurl -s "https://wesalna.com/api/public/countries"Cache: One day.
Cities of a country
A country's cities with coordinates and a ready prayer-times URL for each. Replace JO with any code or name.
/api/public/countries/{code}| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
code | string | Required | JO | ISO code or country name, part of the path. |
Try it live
https://wesalna.com/api/public/countries/JOcurl -s "https://wesalna.com/api/public/countries/JO"Cache: One day.
Supported prayer-time cities
Every city with its own timetable page: Arabic and English name, country, coordinates, timezone, suggested calculation method and both page URLs.
/api/public/cities| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
search | string | Optional | - | Filter by city or country name, in Arabic or English, or by slug. |
Try it live
https://wesalna.com/api/public/citiescurl -s "https://wesalna.com/api/public/cities"Cache: Cached for 24 hours.
Qibla direction
Qibla bearing from true north plus the distance to the Kaaba in kilometres and miles.
/api/public/qibla| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
lat | number | Required | 31.9539 | Between -90 and 90. |
lng | number | Required | 35.9106 | Between -180 and 180. |
Try it live
https://wesalna.com/api/public/qibla?lat=31.9539&lng=35.9106curl -s "https://wesalna.com/api/public/qibla?lat=31.9539&lng=35.9106"Cache: Cached for 24 hours.
Tools
Gold and silver prices with zakat nisab
Gold price per gram for 24k, 22k, 21k and 18k, per ounce, silver, and the zakat nisab in local currency.
/api/public/gold| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
currency | string | Optional | - | Currency code such as SAR. Defaults to USD. |
country | string | Optional | JO | Picks the country currency automatically. |
Try it live
https://wesalna.com/api/public/gold?country=JOcurl -s "https://wesalna.com/api/public/gold?country=JO"Cache: One hour; prices refresh daily.
Weather
Current weather and a 3-day outlook for the city, from Open-Meteo.
/api/public/weatherLocation rule: Send at least one of: city, country, or lat together with lng.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
country | string | Optional | JO | ISO code or name. Alone it returns the capital. |
city | string | Optional | amman | City name or slug, English or Arabic. |
lat | number | Optional | - | Alternative to city/country. |
lng | number | Optional | - | Alternative to city/country. |
timezone | string | Optional | - | Optional IANA identifier. |
Try it live
https://wesalna.com/api/public/weather?country=JO&city=ammancurl -s "https://wesalna.com/api/public/weather?country=JO&city=amman"Cache: 30 minutes.
Hijri date conversion
Convert Gregorian to Hijri with date, or Hijri to Gregorian with hy, hm and hd.
/api/public/hijri| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
date | date | Optional | - | YYYY-MM-DD, defaults to today. |
hy | number | Optional | - | Send with hm and hd for the reverse direction. |
hm | number | Optional | - | Between 1 and 12. |
hd | number | Optional | - | From 1 to the month length. |
Try it live
https://wesalna.com/api/public/hijricurl -s "https://wesalna.com/api/public/hijri"Cache: Cached for 24 hours.
Quran
Quran reference metadata
All 114 surahs, juz starts and sajdah locations, or a single surah by number or slug.
/api/public/quran/meta| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
surah | string | Optional | 2 | Number 1..114 or a slug such as al-baqarah. Leave empty for the full set. |
Try it live
https://wesalna.com/api/public/quran/meta?surah=2curl -s "https://wesalna.com/api/public/quran/meta?surah=2"Cache: Static data, cached long term.
Quran ayah search
Search the mushaf in Arabic or in the English translation with partial, whole-word or Arabic-root matching, filtered by juz or by a surah range.
/api/public/quran/search| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
q | string | Required | الرحمن | At least two characters, with or without diacritics. |
matchType | string | Optional | partial | partial substring, word whole word, root the Arabic root and its derivations. |
wordMode | string | Optional | all | all requires every word, any accepts a single word. |
juz | number | Optional | - | 1..30, leave empty for the whole mushaf. |
surahFrom | number | Optional | - | First surah number in the range. |
surahTo | number | Optional | - | Last surah number in the range. |
limit | number | Optional | 20 | Between 1 and 50. |
offset | number | Optional | - | For paging through results. |
Try it live
https://wesalna.com/api/public/quran/search?q=%D8%A7%D9%84%D8%B1%D8%AD%D9%85%D9%86&matchType=partial&wordMode=all&limit=20curl -s "https://wesalna.com/api/public/quran/search?q=%D8%A7%D9%84%D8%B1%D8%AD%D9%85%D9%86&matchType=partial&wordMode=all&limit=20"Cache: Cached for 24 hours per parameter set.
No-code embed builder
Pick the city, style and colours, then copy a ready iframe. The widget shows the Wesalna link automatically.
The widget refreshes itself for every visitor, using the city and calculation method you selected.
Next prayer
Dhuhr
--:--
Time remaining:
- Fajr--:--
- Dhuhr--:--
- Asr--:--
- Maghrib--:--
- Isha--:--
Terms of use and attribution
Free with one condition: a visible link to Wesalna next to the data. Attribution is not a separate page or file; it is a ready field inside every response named attribution.html.
The ready attribution link inside the response (attribution.html field)
Every request you send comes back with this field already filled in. The developer or the AI assistant never needs to search any page for it; they just render it near the times.
{
"ok": true,
"times": { "fajr": { "local": "05:12" }, "...": "..." },
"attribution": {
"required": true,
"text": "Prayer times by Wesalna",
"textAr": "مواقيت الصلاة من وصالنا",
"url": "https://wesalna.com",
"html": "<a href=\"https://wesalna.com\" target=\"_blank\" rel=\"noopener\">Prayer times by Wesalna</a>",
"htmlAr": "<a href=\"https://wesalna.com\" target=\"_blank\" rel=\"noopener\">مواقيت الصلاة من وصالنا</a>"
}
}Use htmlAr on Arabic sites and html on English ones. There is no page called attribution.html and you never need to visit one.
Do
- Render the attribution.html field as-is near the times.
- A normal, visible, clickable link.
- Cache responses and identify your client with a User-Agent.
Don't
- Hide the link with styling or remove it.
- Add rel="nofollow".
- Alter calculations in ways that change their religious meaning.
Ready attribution snippets
<a href="https://wesalna.com" target="_blank" rel="noopener">Prayer times by Wesalna</a><a href="https://wesalna.com" target="_blank" rel="noopener">مواقيت الصلاة من وصالنا</a><a href="https://wesalna.com" target="_blank" rel="noopener" style="display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;border:1px solid #2d8a9e;color:#2d8a9e;font:600 12px system-ui;text-decoration:none">Powered by Wesalna</a>Errors and caching
Every error returns a message and a hint that explains the fix.
{
"ok": false,
"error": {
"status": 422,
"message": "Unknown city.",
"hint": "See https://wesalna.com/api/public/countries for every supported city."
}
}| 400 | Missing or unreadable parameter, for example a non-numeric lat. |
| 404 | Resource not found, such as an unknown surah. |
| 422 | Well-formed value that is out of range or unsupported. |
| 500 | Unexpected service error; retry later. |
| /api/public/prayer-times | 5 minutes for today, one year when date is given. |
| /api/public/prayer-calendar | 5 minutes when year is omitted; one year when year is explicitly provided. |
| /api/public/next-prayer | 30 seconds. |
| /api/public/countries | One day. |
| /api/public/countries/{code} | One day. |
| /api/public/methods | One day. |
| /api/public/gold | One hour; prices refresh daily. |
| /api/public/weather | 30 minutes. |
| /api/public/cities | Cached for 24 hours. |
| /api/public/qibla | Cached for 24 hours. |
| /api/public/hijri | Cached for 24 hours. |
| /api/public/quran/meta | Static data, cached long term. |
| /api/public/quran/search | Cached for 24 hours per parameter set. |
Frequently asked questions
Is it really free?
Yes, no key and no account. The only condition is a visible link to Wesalna next to the data.
Do I need latitude and longitude?
No. Send country alone (returns the capital) or country with city in English or Arabic. Coordinates are an optional alternative.
How is the calculation method chosen?
Automatically per country, for example Umm al-Qura for Saudi Arabia and Karachi with Hanafi Asr for Pakistan. Override with method and madhhab.
Can I call it from the browser?
Yes, CORS is open to every origin.
What about countries with several time zones?
In countries such as the US or Russia pass a timezone for exact local times; the response flags it.
What you can build today, and what is in progress
This page is for developers who want prayer times or Quran data inside their own site or app. Everything listed here is published and working now on the same public origin, with no key and no signup, and no unverified promises.
Available now
- Published JSON endpoints: prayer times by country and city name, monthly and yearly prayer calendars, next prayer, Qibla direction, Hijri date conversion, countries, cities and calculation methods, gold and silver prices with the zakat nisab, weather, Quran reference metadata and ayah search. All of them live under the public /api/public path and return clean JSON.
- Docs for humans and machines: every endpoint is documented at the top of this page with samples, fields and ready snippets, plus OpenAPI, llms.txt, the AI assistant guide and an MCP server on the /mcp path.
- Prayer times embed: a copy ready snippet from the embed page, with city, calculation method and theme, refreshing daily.
- Surah share images: a public route that renders an SVG card per surah in Uthmani script, used by the site itself for share previews.
- Stable deep links: paths such as /quran/al-baqarah, /prayer-times and /qibla are safe to link to from your app, in all three languages via the /en and /fr prefixes.
What we are working on now
- Adding more countries and cities to the prayer times in spaced batches, so the country and city lists grow gradually.
- Extending the per-city Ramadan imsakiya pages in further batches.
- Measuring real widget and API usage to tune rate limits and documentation.
Fair use rules
- Do not send heavy automated traffic; cache responses on your server instead of requesting per visitor.
- Keep source attribution wherever our data is displayed.
- Do not attribute a ruling or interpretation to us that we did not publish.
- Review the terms of use before any commercial use.
To ask about an endpoint's status or request a priority, write to us from the contact page.
Frequently asked questions