BYTETOOLS

Al Adhan Prayer Times API

Free prayer times API with no key: daily Islamic prayer times for any city or coordinates, with multiple calculation methods and Hijri date conversion. Tested.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 20 Aug 2026

What is the Al Adhan Prayer Times API?

The Al Adhan API is a free, key-free API providing Islamic prayer times for any location worldwide, supporting multiple calculation methods and madhabs, plus Gregorian-to-Hijri calendar conversion.

Prayer times depend on solar geometry, and different Islamic authorities calculate them using different solar angles — which means there is no single correct answer. The `method` parameter selects the authority, and picking the right one for your audience matters.

Method 2 (Islamic Society of North America) and method 4 (Umm Al-Qura, Makkah) produce noticeably different Fajr and Isha times for the same location. Any application serving a specific community should let users choose rather than hardcoding one.

Quick facts

Base URL
https://api.aladhan.com/v1
Authentication
No API key required.
Rate limit
No published hard limit; fair use expected.
Pricing
Free.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Al Adhan Prayer Times API

Every request below was executed against the live API on 20 Aug 2026, and the response shown is the real body it returned — not an illustration.

1. Fetch prayer times for a city

GET https://api.aladhan.com/v1/timingsByCity?city=London&country=UK&method=2

curl
curl 'https://api.aladhan.com/v1/timingsByCity?city=London&country=UK&method=2'
JavaScript (fetch)
const res = await fetch("https://api.aladhan.com/v1/timingsByCity?city=London&country=UK&method=2");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://api.aladhan.com/v1/timingsByCity?city=London&country=UK&method=2", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200 (truncated)
{
  "code": 200,
  "status": "OK",
  "data": {
    "timings": {
      "Fajr": "04:05",
      "Sunrise": "05:54",
      "Dhuhr": "13:04",
      "Asr": "17:00",
      "Sunset": "20:13",
      "Maghrib": "20:13",
      "Isha": "22:01",
      "Imsak": "03:55",
      "Midnight": "01:03",
      "Firstthird": "23:27",
      "Lastthird": "02:40"
    },
    "date": {
      "readable": "20 Aug 2026",
      "timestamp": "1787205600",
      "hijri": {
        "date": "07-03-1448",
        "format": "DD-MM-YYYY",
        "day": "7",
        "weekday": {
          "en": "Al Khamees",
          "ar": "الخميس"
        },
        "month": {
          "number": 3,
          "en": "Rabīʿ al-awwal",
          "ar": "رَبيع الأوّل",
          "days": 29
        },
        "year": "1448",
        "designation": {
          "abbreviated": "AH",
          "expanded": "Anno Hegirae"
        },
        "holidays": [],
        "adjustedHolidays": [],
        "method": "HJCoSA"
      },
      "gregorian": {
        "date": "20-08-2026",
        "format": "DD-MM-YYYY",
        "day": "20",
        "weekday": {
          "en": "Thursday"
        },
        "month": {
          "number": 8,
          "en": "August"
        },
        "year": "2026",
        "designation": {
          "abbreviated": "AD",
          "expanded": "Anno Domini"
        },
        "lunarSighting": false
      }
    },
    "meta": {
      "latitude": 8.8888888,
      "longitude": 7.7777777,
      "timezone": "Europe/London",
      "method": {
        "id": 2,
        "name": "Islamic Society of North America (ISNA)",
        "pa

2. Convert a Gregorian date to the Hijri calendar

GET https://api.aladhan.com/v1/gToH/20-08-2026

curl
curl 'https://api.aladhan.com/v1/gToH/20-08-2026'
JavaScript (fetch)
const res = await fetch("https://api.aladhan.com/v1/gToH/20-08-2026");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://api.aladhan.com/v1/gToH/20-08-2026", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
{
  "code": 200,
  "status": "OK",
  "data": {
    "hijri": {
      "date": "07-03-1448",
      "format": "DD-MM-YYYY",
      "day": "7",
      "weekday": {
        "en": "Al Khamees",
        "ar": "الخميس"
      },
      "month": {
        "number": 3,
        "en": "Rabīʿ al-awwal",
        "ar": "رَبيع الأوّل",
        "days": 29
      },
      "year": "1448",
      "designation": {
        "abbreviated": "AH",
        "expanded": "Anno Hegirae"
      },
      "holidays": [],
      "adjustedHolidays": [],
      "method": "HJCoSA"
    },
    "gregorian": {
      "date": "20-08-2026",
      "format": "DD-MM-YYYY",
      "day": "20",
      "weekday": {
        "en": "Thursday"
      },
      "month": {
        "number": 8,
        "en": "August"
      },
      "year": "2026",
      "designation": {
        "abbreviated": "AD",
        "expanded": "Anno Domini"
      },
      "lunarSighting": false
    }
  }
}

Parameters

ParameterTypeRequiredDescription
timingsByCitypathOptionalPrayer times by city and country. timingsByCity?city=London&country=UK
methodintegerOptionalCalculation authority — 2 is ISNA, 4 is Umm Al-Qura. 2
schoolintegerOptional0 Shafi, 1 Hanafi — affects Asr timing. 0
timingspathOptionalPrayer times by coordinates. timings?latitude=51.5&longitude=-0.12
gToH/<date>pathOptionalConvert a Gregorian date to Hijri. gToH/20-08-2026

Response fields

code / statusinteger|string
200 and OK on success.
data.timingsobject
Fajr, Sunrise, Dhuhr, Asr, Maghrib, Isha and others as HH:MM.
data.date.readablestring
Gregorian date.
data.date.hijriobject
Hijri date with month name, year and weekday.
data.meta.methodobject
Which calculation method was applied.
data.meta.timezonestring
Timezone the times are expressed in.

What you can build with the Al Adhan Prayer Times API

  • Display daily prayer times in a mosque or community app
  • Build a prayer reminder or notification service
  • Convert between Gregorian and Hijri calendars
  • Add Ramadan timing features with Imsak and Maghrib

Common errors and how to fix them

Times differ from local mosque

Calculation methods disagree by design.

Fix: Let users select the `method` matching their local authority rather than hardcoding one.

Asr time seems wrong

Shafi and Hanafi schools calculate Asr differently.

Fix: Set `school` — 0 for Shafi, 1 for Hanafi — which shifts Asr meaningfully.

Request redirects to a dated URL

Undated requests resolve to today.

Fix: That is intended behaviour; the redirect target contains today's date.

Al Adhan Prayer Times API — frequently asked questions

Is the prayer times API free?

Yes, completely free with no API key required.

Why do the times differ from my local mosque?

Different Islamic authorities use different solar angles for Fajr and Isha, so there is no single correct answer. Use the `method` parameter to match your local authority.

What does the school parameter do?

It selects the Asr calculation — 0 for Shafi, 1 for Hanafi. The two produce meaningfully different Asr times, so it matters for your audience.

Can it convert Gregorian dates to Hijri?

Yes, the /gToH endpoint converts in that direction and /hToG converts back, both with full month names.

Tools that pair with this API

Alternatives to Al Adhan Prayer Times API

If Al Adhan Prayer Times does not fit, these utility apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.

APIWhat it doesAuthCORSLast verified
AgifyFree API that estimates age from a first name using public name data. No key for 100 requests/day. Tested curl example, live response and accuracy caveats.No keyYes19 Aug 2026
GenderizeFree API estimating the gender statistically associated with a first name, with a probability score. 100 requests/day, no key. Tested example and caveats.No keyYes19 Aug 2026
NationalizeFree API predicting likely nationality from a first name, returning ranked countries with probabilities. 100 requests/day, no key. Tested curl example.No keyYes19 Aug 2026
Random User GeneratorFree random user generator API with no key: names, addresses, emails, photos and logins in multiple nationalities. Seeded and reproducible. Tested example.No keyYes19 Aug 2026
Bacon IpsumFree lorem ipsum style placeholder text API with no key. Generate meat-themed filler paragraphs or sentences via a simple GET request. Tested example.No keyYes19 Aug 2026
BarcodeAPI.orgFree barcode generator API with no key: Code128, EAN, UPC, QR, Code39, ITF and more as PNG or base64 JSON from a plain URL. Tested example included.No keyYes21 Aug 2026
All Utility APIs

Al Adhan Prayer Times is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 20 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.