Prayer Times

FREE
By meezaan
Updated 6 days ago
Tools
9.5/10
Popularity Score
1944ms
Latency
89%
Success Rate

Prayer Times API Documentation

A flexible RESTful prayer times API that returns JSON times for a given day or a calendar for a whole month.

For more detailed documentation, various methods and additional endpoints, please see the complete documentation on http://aladhan.com/prayer-times-api.

View API Details
By City
GETPrayer Times by City
GETPrayer Times Calendar by city
By Address
GETPrayer Times by Address
GETCalendar by Address
GETPrayer Times by City

Get Prayer Times for a given day by city and country

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
citySTRING
REQUIREDA city name, like Denver
countrySTRING
REQUIREDA country name or ISO 2 digit aplha code, like 'US' or 'United States of America'
Optional Parameters
stateSTRING
OPTIONALA US state name or 2 letter abbreviation, like 'Colorado' or 'CO'
methodNUMBER
OPTIONALAny of the prayer time calculation methods specified on https://aladhan.com/calculation-methods
schoolNUMBER
OPTIONAL1 for Hanfi. 0 for all others, including, Shafi, Hanbali, etc.
latitudeAdjustmentMethodNUMBER
OPTIONALMethod for adjusting times higher latitudes - for instance, if you are checking timings in the UK or Sweden. 1 - Middle of the Night 2 - One Seventh 3 - Angle Based
Code Snippet
unirest.get("https://aladhan.p.rapidapi.com/timingsByCity")
.header("X-RapidAPI-Host", "aladhan.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://aladhan.p.rapidapi.com/timingsByCity
Request Method: GET
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://aladhan.p.rapidapi.com/timingsByCity")
.header("X-RapidAPI-Host", "aladhan.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication