Overview
The prayer times API provides functions to fetch prayer times from the Aladhan API. All functions return prayer data including:- All daily prayer times (Fajr, Sunrise, Dhuhr, Asr, Maghrib, Isha)
- Gregorian and Hijri date information
- Calculation method and school metadata
- Timezone and coordinate information
Fetch by City
fetchTimingsByCity
Fetch prayer times for a specific city and country.FetchByCityOptions
required
Configuration object for fetching prayer times
Promise<PrayerData>
Returns a promise that resolves to prayer data
Fetch by Address
fetchTimingsByAddress
Fetch prayer times using a free-form address string. The API will geocode the address.FetchByAddressOptions
required
Promise<PrayerData>
Prayer data for the specified address
Fetch by Coordinates
fetchTimingsByCoords
Fetch prayer times using latitude and longitude coordinates.FetchByCoordsOptions
required
Promise<PrayerData>
Prayer data for the coordinates
Next Prayer
fetchNextPrayer
Fetch the next upcoming prayer time for today.FetchNextPrayerOptions
required
Promise<NextPrayerData>
Prayer data with next prayer information
Ramadan Calendar
fetchCalendarByCity
Fetch the entire Ramadan prayer calendar for a city.FetchCalendarByCityOptions
required
Promise<ReadonlyArray<PrayerData>>
Array of prayer data for each day
fetchCalendarByAddress
Fetch prayer calendar using an address string.FetchCalendarByAddressOptions
required
Same as
FetchCalendarByCityOptions but with address instead of city/countryfetchHijriCalendarByCity
Fetch Ramadan calendar using Hijri calendar date.FetchHijriCalendarByCityOptions
required
fetchHijriCalendarByAddress
Fetch Hijri calendar using an address.Calculation Methods
fetchMethods
Get all available prayer time calculation methods.Promise<MethodsResponse>
Record mapping method IDs to calculation method details
Common Calculation Methods
Qibla Direction
fetchQibla
Get the Qibla direction (bearing to Mecca) for any location.number
required
Latitude coordinate
number
required
Longitude coordinate
Promise<QiblaData>
Qibla direction data