Simple Requests
One GET request returns all five prayer times, sunrise and the qibla direction
Global Coverage
Works anywhere in the world with lat/long coordinates
Highly Accurate
Based on astronomical calculations using Adhan library
Free to Use
Please keep request volume reasonable; limits may be added
Get Started in 2 Minutes
No API Key Required: No registration or API key is needed. Free to use. Please keep request volume reasonable; limits may be added. Just add attribution=islamcave.com to your requests.
GET https://islamcave.com/api/prayer-times?
latitude=40.7128&
longitude=-74.0060&
attribution=islamcave.comTry It Now
Code Examples
Time zone note: the times values are UTC timestamps (ISO 8601) and are correct for any location. The formatted values, used in the examples below, currently use the server time zone rather than the time zone of the requested location. Until this is fixed, convert the times values to local time in your app.
// Fetch prayer times for New York City
const response = await fetch(
'https://islamcave.com/api/prayer-times?' +
'latitude=40.7128&longitude=-74.0060&' +
'attribution=islamcave.com'
);
const data = await response.json();
console.log('Fajr:', data.data.formatted.fajr);
console.log('Dhuhr:', data.data.formatted.dhuhr);
console.log('Asr:', data.data.formatted.asr);
console.log('Maghrib:', data.data.formatted.maghrib);
console.log('Isha:', data.data.formatted.isha);API Documentation
Endpoint
GET https://islamcave.com/api/prayer-timesQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| latitude | number | Yes | Latitude coordinate (-90 to 90) |
| longitude | number | Yes | Longitude coordinate (-180 to 180) |
| date | string | No | Date in YYYY-MM-DD format (default: today) |
| method | string | No | Calculation method (default: MWL). See below for options |
| madhab | string | No | "hanafi" or "shafi" (default: shafi) - affects Asr time |
| attribution | string | Recommended | Set to "islamcave.com" to acknowledge attribution |
Calculation Methods
An unknown method returns a 400 error that lists the valid codes.
MWLMuslim World League
Standard method, used globally
ISNAIslamic Society of North America
Used in USA and Canada
EGYPTEgyptian General Authority
Used in Egypt and Middle East
MAKKAHUmm al-Qura University
Used in Saudi Arabia
KARACHIUniversity of Islamic Sciences, Karachi
Used in Pakistan
DUBAIDubai
Used in UAE
QATARQatar
Used in Qatar
KUWAITKuwait
Used in Kuwait
SINGAPORESingapore
Used in Singapore and Malaysia
TURKEYTurkey
Diyanet İşleri Başkanlığı
Attribution Required
This API is free to use. Please keep request volume reasonable; limits may be added. We only ask that you:
- Add a link to IslamCave.com from your website or app
- Include
attribution=islamcave.comin API requests - Display "Powered by IslamCave" somewhere in your application
Example attribution:
<a href="https://islamcave.com">Prayer times powered by IslamCave</a>