Skip to main content

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.

Base URLhttps://wesalna.com/api/public

Interactive 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.

Open in a new tab
Request
GET https://wesalna.com/api/public/prayer-times?lat=31.9539&lng=35.9106&method=MuslimWorldLeague&madhhab=standard&timezone=Asia%2FAmman

Response

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

FieldTypeDescription
times.<prayer>.utcstringPrayer instant as an ISO 8601 UTC string.
times.<prayer>.localstringHH:mm time in the requested timezone.
extras.imsak | midnight | lastThirdobjectSupporting times for fasting and night prayer.
date.hijriobjectHijri day, month, year with the month name in Arabic and English.
qibla.bearingnumberQibla bearing in degrees from true north.
cityobjectCity 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.

CodeMeaning
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.

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

  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