All guides All docs

Prayer times API: times for any place with your chosen method

GET /v1/prayer-times?lat=-6.2&lng=106.816&date=2026-12-01 returns Fajr, sunrise, Dhuhr, Asr, Maghrib, Isha and imsak for that point and day, computed with the method you pick: MWL, ISNA, Egypt, Umm al-Qura, Karachi, Diyanet, JAKIM, MUIS or Kemenag. Each call costs 1 credit, and Singapore can use the official MUIS timetable instead.

Last checked . Service: Prayer times API. Reference: endpoint docs.

Choosing a calculation method

Methods differ mainly in the sun angles for Fajr and Isha. The response shows them in angles, 20° and 18° for Kemenag in the example. Without method, APIFor picks the default for the country of the point, and falls back to MWL (Muslim World League).

Use method=ISNA for North America, Diyanet for Turkey, UmmAlQura for Saudi Arabia, JAKIM for Malaysia and MUIS for Singapore if you want to match the local mosque. asr=hanafi switches Asr to the Hanafi shadow rule.

Request

Send your key in the x-api-key header. New accounts get 1,000 free requests after email verification; the quickstart takes about a minute.

GETcurl
curl 'https://api.apifor.dev/v1/prayer-times?lat=-6.2&lng=106.816&date=2026-12-01' \
  -H 'x-api-key: YOUR_API_KEY'
Python
import os
import requests

r = requests.get(
    "https://api.apifor.dev/v1/prayer-times",
    params={
        "lat": "-6.2",
        "lng": "106.816",
        "date": "2026-12-01",
    },
    headers={"x-api-key": os.environ["APIFOR_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
JavaScript
const res = await fetch("https://api.apifor.dev/v1/prayer-times?lat=-6.2&lng=106.816&date=2026-12-01", {
  headers: { "x-api-key": process.env.APIFOR_API_KEY },
});
const { data } = await res.json();
console.log(data);

Response

This is the example recorded from the live API and published in our OpenAPI spec. Long lists and strings are shortened here. The full spec is at api.apifor.dev/v1/openapi.json.

200 OK
{
  "success": true,
  "data": {
    "date": "2026-12-01",
    "lat": -6.2,
    "lng": 106.816,
    "timezone": "Asia/Jakarta",
    "utc_offset": "+07:00",
    "method": "Kemenag",
    "method_name": "Kementerian Agama Republik Indonesia",
    "asr_school": "standard",
    "angles": {
      "fajr": 20,
      "isha": 18,
      "isha_minutes_after_maghrib": null
    },
    "fajr": "04:06",
    "sunrise": "05:26",
    "dhuhr": "11:44",
    "asr": "15:09",
    "maghrib": "17:57",
    "isha": "19:13",
    "imsak": "03:56",
    "computed": true,
    "high_latitude_rule": null,
    "adjusted": [],
    "polar_day_or_night": false
  },
  "meta": {
    "attribution": {
      "source": "https://apifor.dev/docs/prayer-times",
      "licence": "Computed (no third-party data)",
      "license": "Computed (no third-party data)",
      "license_url": "https://apifor.dev/sources",
      "source_url": "https://apifor.dev/docs/prayer-times",
      "attribution_page": "https://apifor.dev/sources",
      "notice": "Computed by APIFor from solar position formulas with the published angles of the chosen method; not an official timetable. Local authorit..."
    },
    "timezone_source": "timezone"
  }
}

Time zones and high latitudes

Times are local. Pass an IANA zone such as timezone=Europe/London; single-zone countries get their zone automatically, and the rest default to UTC. utc_offset in the response shows what was applied.

Far north or south, Fajr and Isha can be undefined in summer. The response then fills high_latitude_rule and adjusted to show which times were moved, and flags polar_day_or_night where the sun does not set or rise.

Official timetables

country=SG without coordinates returns the MUIS timetable published on data.gov.sg (2024 to 2026). Indonesia's Ministry of Religious Affairs table is available by regency. Everywhere else the times are computed, and the response says so: local authorities may differ by one to three minutes.

Errors, limits and cost

A missing or wrong key returns 401, bad parameters return 400 with an error.code, and an unknown id returns 404. Rate limits are per key: a limited request gets 429 with a Retry-After header in seconds, so wait that long and retry. Calls that fail before any work starts are refunded. Details are in errors and rate limits.

This request costs 1 credit. Pricing is prepaid: 1,000 free requests once after email verification, then packs from $5 for 5,000 requests to $149 for 400,000. Credits never expire and there is no subscription. See pricing.

From an AI assistant

The same data is available as a tool on the APIFor MCP server at https://mcp.apifor.dev/mcp. Add it as a remote server in any client that supports remote MCP, sign in with OAuth or send your API key as a Bearer token, and ask in plain language. MCP calls use the same key and credits as REST. Setup steps are on the MCP page.

Alternatives

  • AlAdhan prayer times API: Free and keyless, with many calculation methods. On 1 Dec 2026, /v1/timings with London coordinates and method 3 returned a full day of times.

Facts about other services come from their own pages or a test call on 1 Dec 2026. Prices and limits change, so confirm them there.

Source and licence

Computed by APIFor from solar position formulas with the published angles of each method; not an official timetable. Singapore: contains information from the Muslim Prayer Timetable accessed from data.gov.sg, Singapore Open Data Licence v1.0.

Every APIFor response carries the same attribution in meta.attribution. All sources are listed on sources and licences.

FAQ

Which prayer time method should I use?

The one your local mosque or authority uses. If you are not sure, leave method out and APIFor uses the default for the country, or MWL.

Does it support the Hanafi Asr time?

Yes. Add asr=hanafi.

Can I get a whole month at once?

Computed times are one day per call. For Singapore, the official timetable takes from and to dates and returns a range.