Developer platform
Developer platform
Public JSON endpoints for prayer times, Qibla, Hijri dates and Quran reference data, with an interactive sandbox that runs every request straight from this page.
No keys, no signup
Every public endpoint is an open read-only GET. No account and no access token.
Open CORS
Call it straight from the browser: access-control-allow-origin is set to *.
Cached responses
Prayer times cache for 5 minutes, Qibla and Hijri for 24 hours, Quran metadata long term.
Fair use
No hard quota today; stay under roughly 60 requests per minute per client and respect the cache.
https://wesalna.com/api/publicInteractive sandbox
Pick an endpoint, tune the parameters, then fire a real request and inspect the live response, timing and size.
Prayer times
Precise astronomical prayer times for one day by coordinates or by a supported city slug, plus imsak, midnight, last third, the Hijri date and the Qibla bearing.
Between -90 and 90. Required unless city is sent.
Between -180 and 180. Required unless city is sent.
A supported slug such as makkah instead of coordinates; it also sets the timezone and calculation method. List at /api/public/cities.
Format YYYY-MM-DD, defaults to today.
One of the supported methods.
standard for the majority, hanafi for the Hanafi view.
IANA identifier such as Asia/Amman for local times.
GET https://wesalna.com/api/public/prayer-times?lat=31.9539&lng=35.9106&method=MuslimWorldLeague&madhhab=standard&timezone=Asia%2FAmmanResponse
No request yet. Press "Send request" to see a live response from the service.
Code samples
curl -s "https://wesalna.com/api/public/prayer-times?lat=31.9539&lng=35.9106&method=MuslimWorldLeague&madhhab=standard&timezone=Asia%2FAmman"Response fields
| Field | Type | Description |
|---|---|---|
times.<prayer>.utc | string | Prayer instant as an ISO 8601 UTC string. |
times.<prayer>.local | string | HH:mm time in the requested timezone. |
extras.imsak | midnight | lastThird | object | Supporting times for fasting and night prayer. |
date.hijri | object | Hijri day, month, year with the month name in Arabic and English. |
qibla.bearing | number | Qibla bearing in degrees from true north. |
city | object | City details and its Arabic and English page URLs, present when city is sent. |
Cached for 5 minutes.
Errors and handling
Every error returns a stable JSON shape with error.status, error.message and usually an error.hint explaining the fix.
| Code | Meaning |
|---|---|
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. |
Error example
{
"ok": false,
"error": {
"status": 422,
"message": "Coordinates out of range.",
"hint": "lat must be -90..90 and lng must be -180..180."
}
}Embed the prayer widget
If you want a ready-made surface instead of building one, embed the prayer widget with a single iframe.
<iframe
src="https://wesalna.com/embed/prayer"
title="Wesalna prayer times"
width="100%"
height="360"
style="border:0;border-radius:16px"
></iframe>Usage terms: keep the returned calculations unmodified in ways that change their religious meaning, and credit Wesalna as the data source.
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. It separates what is available now from what is in progress, with no unverified promises.
Available now
- 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 both languages via the /en prefix.
In progress
JSON endpoints for prayer times, Qibla, Hijri conversion and surah metadata. We are finishing rate limiting and documentation before announcing them, and prefer a delay over shipping an unstable API that breaks other people's apps.
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