Skip to main content
Completely free - no API key

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.

226
countries
2,600+
cities
13
endpoints
10
methods
0
keys or signup

Quick start in 30 seconds

One request is enough. No coordinates needed: country and city by name, method picked automatically.

GEThttps://wesalna.com/api/public/prayer-times?country=JO&city=amman
curl -s "https://wesalna.com/api/public/prayer-times?country=JO&city=amman"
No key, no signup
Open CORS for browsers
Fast cached responses
One rule: attribution link

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.

GET/api/public/prayer-times

Location rule: Send at least one of: city, country, or lat together with lng.

ParameterTypeStatusDefaultDescription
countrystringOptionalJOISO code or name such as JO or jordan. Alone it returns the capital; with city it disambiguates. List at /api/public/countries.
citystringOptionalammanCity name or slug in English or Arabic, such as amman or عمان, instead of coordinates. Sets timezone, method and Asr school automatically.
latnumberOptional-Between -90 and 90. Required unless city or country is sent.
lngnumberOptional-Between -180 and 180. Required unless city or country is sent.
datedateOptional-Format YYYY-MM-DD, defaults to today.
methodstringOptional-Optional. Defaults to the method used in the requested country, otherwise Muslim World League.
madhhabstringOptional-standard for the majority, hanafi for the Hanafi view.
timezonestringOptional-IANA identifier such as Asia/Amman for local times.

Try it live

https://wesalna.com/api/public/prayer-times?country=JO&city=amman
curl -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.

GET/api/public/prayer-calendar

Location rule: Send at least one of: city, country, or lat together with lng.

ParameterTypeStatusDefaultDescription
countrystringOptionalJOISO code or name. Alone it returns the capital.
citystringOptionalammanCity name or slug, English or Arabic.
latnumberOptional-Alternative to city/country.
lngnumberOptional-Alternative to city/country.
timezonestringOptional-Optional IANA identifier.
yearnumberOptional-Defaults to the current year.
monthnumberOptional11..12, empty for the whole year.

Try it live

https://wesalna.com/api/public/prayer-calendar?country=JO&city=amman&month=1
curl -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.

GET/api/public/next-prayer

Location rule: Send at least one of: city, country, or lat together with lng.

ParameterTypeStatusDefaultDescription
countrystringOptionalJOISO code or name. Alone it returns the capital.
citystringOptionalammanCity name or slug, English or Arabic.
latnumberOptional-Alternative to city/country.
lngnumberOptional-Alternative to city/country.
timezonestringOptional-Optional IANA identifier.

Try it live

https://wesalna.com/api/public/next-prayer?country=JO&city=amman
curl -s "https://wesalna.com/api/public/next-prayer?country=JO&city=amman"

Cache: 30 seconds.

Calculation methods

All supported calculation methods and Asr schools.

GET/api/public/methods

Try it live

https://wesalna.com/api/public/methods
curl -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.

GET/api/public/countries
ParameterTypeStatusDefaultDescription
searchstringOptional-Country name or code.
muslimstringOptional-Send 1 to filter.
arabicstringOptional-Send 1 to filter.

Try it live

https://wesalna.com/api/public/countries
curl -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.

GET/api/public/countries/{code}
ParameterTypeStatusDefaultDescription
codestringRequiredJOISO code or country name, part of the path.

Try it live

https://wesalna.com/api/public/countries/JO
curl -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.

GET/api/public/cities
ParameterTypeStatusDefaultDescription
searchstringOptional-Filter by city or country name, in Arabic or English, or by slug.

Try it live

https://wesalna.com/api/public/cities
curl -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.

GET/api/public/qibla
ParameterTypeStatusDefaultDescription
latnumberRequired31.9539Between -90 and 90.
lngnumberRequired35.9106Between -180 and 180.

Try it live

https://wesalna.com/api/public/qibla?lat=31.9539&lng=35.9106
curl -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.

GET/api/public/gold
ParameterTypeStatusDefaultDescription
currencystringOptional-Currency code such as SAR. Defaults to USD.
countrystringOptionalJOPicks the country currency automatically.

Try it live

https://wesalna.com/api/public/gold?country=JO
curl -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.

GET/api/public/weather

Location rule: Send at least one of: city, country, or lat together with lng.

ParameterTypeStatusDefaultDescription
countrystringOptionalJOISO code or name. Alone it returns the capital.
citystringOptionalammanCity name or slug, English or Arabic.
latnumberOptional-Alternative to city/country.
lngnumberOptional-Alternative to city/country.
timezonestringOptional-Optional IANA identifier.

Try it live

https://wesalna.com/api/public/weather?country=JO&city=amman
curl -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.

GET/api/public/hijri
ParameterTypeStatusDefaultDescription
datedateOptional-YYYY-MM-DD, defaults to today.
hynumberOptional-Send with hm and hd for the reverse direction.
hmnumberOptional-Between 1 and 12.
hdnumberOptional-From 1 to the month length.

Try it live

https://wesalna.com/api/public/hijri
curl -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.

GET/api/public/quran/meta
ParameterTypeStatusDefaultDescription
surahstringOptional2Number 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=2
curl -s "https://wesalna.com/api/public/quran/meta?surah=2"

Cache: Static data, cached long term.

No-code embed builder

Pick the city, style and colours, then copy a ready iframe. The widget shows the Wesalna link automatically.

Countdown
All prayer times
Gregorian date
Hijri date
Weather
City name
Wesalna credit

The widget refreshes itself for every visitor, using the city and calculation method you selected.

Next prayer

Dhuhr

--:--

Time remaining:

MakkahDecember 6, 202626 Jumada al-Akhirah 1448 AH
  • Fajr--:--
  • Dhuhr--:--
  • Asr--:--
  • Maghrib--:--
  • Isha--:--
Powered by Wesalna

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>"
  }
}
Preview as it appears to a visitor of your site:Prayer times by Wesalnaمواقيت الصلاة من وصالنا

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

Text link
<a href="https://wesalna.com" target="_blank" rel="noopener">Prayer times by Wesalna</a>
Arabic text
<a href="https://wesalna.com" target="_blank" rel="noopener">مواقيت الصلاة من وصالنا</a>
Badge
<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."
  }
}
400Missing or unreadable parameter, for example a non-numeric lat.
404Resource not found, such as an unknown surah.
422Well-formed value that is out of range or unsupported.
500Unexpected service error; retry later.
/api/public/prayer-times5 minutes for today, one year when date is given.
/api/public/prayer-calendar5 minutes when year is omitted; one year when year is explicitly provided.
/api/public/next-prayer30 seconds.
/api/public/countriesOne day.
/api/public/countries/{code}One day.
/api/public/methodsOne day.
/api/public/goldOne hour; prices refresh daily.
/api/public/weather30 minutes.
/api/public/citiesCached for 24 hours.
/api/public/qiblaCached for 24 hours.
/api/public/hijriCached for 24 hours.
/api/public/quran/metaStatic data, cached long term.
/api/public/quran/searchCached 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

  1. Do not send heavy automated traffic; cache responses on your server instead of requesting per visitor.
  2. Keep source attribution wherever our data is displayed.
  3. Do not attribute a ruling or interpretation to us that we did not publish.
  4. 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