Ramadan Time

Prayer Times APIVersion 1.0



Product by:

  • General Start
  • Asr Jurisdiction
  • Calculation Methods
  • Parameters
  • Example Code

The API for Prayers / Ramadan Times is solely developed to facilitate the users anywhere with an internet and developers. All the mobile/tablet/desktop devices and updated browser is compatible with our API page. This API home is not just a piece of codewalk but it is a portal for all tech and non-tech savvy friends who want to know their prayer times according to their location. On the arrival of the Holy month Ramadan, this API also helps you see your daily Suhoor / Iftaar timings.

Further information regarding the features, usage and our journey to reach this milestone, please read our blog.

The following details is now dedicated to developers as how will they be able to use our API. There are certain adjustment parameters for the jurisdiction of Asr, calculation methods of prayer times and some common parameters such as geo coordinates, date and so on. For your ease, constants are defined to calculate the prayer times for your app.

Asr Jurisdiction

Asr Jurisdiction Type Value
Shafai'i
int
0
Hanafi
int
1

Calculation Methods

Calculation Methods Type Value
University of Islamic Sciences, Karachi
int
0
Ithna Ashari
int
1
Islamic Society of North America (ISNA)
int
2
Muslim World League (MWL)
int
3
Umm al-Qura, Makkah
int
4
Egyptian General Authority of Survey
int
5
Institute of Geophysics, University of Tehran
int
6

Parameters

Adjustment Parameters Description Type
Year Current year
int
Month Month of a year
int
Day Day of a month
int
Latitude Latitude of a location (one of the geo-coordinates)
double
Longitude Longitude of a location (one of the geo-coordinates)
double
TimeZone TimeZone of your location
float
Daylight Saving Daylight saving is being observed in this area or not
boolean
AsrJurisdiction As described in the above table
int
CalcMethod As described in the above table
int

Example Code

C# Code:

MobileServiceClient client = new MobileServiceClient("https://ramadantimeservice.azure-mobile.net", "<APIKey>");

Dictionary<string, string> parameters = new Dictionary<string, string>();

parameters.Add("year", "2015");

parameters.Add("month", "06");

parameters.Add("day", "15");

parameters.Add("latitude", "21.4200");

parameters.Add("longitude", "39.8300");

parameters.Add("timeZone", "+3");

parameters.Add("dayLightSaving", "false");

parameters.Add("calcMethod", "1");

parameters.Add("asrJurisdiction", "0");

Newtonsoft.Json.Linq.JToken RamadanTimes = await client.InvokeApiAsync("Ramadan", System.Net.Http.HttpMethod.Get, parameters);

RamadanT rt = JsonConvert.DeserializeObject<RamadanT>(RamadanTimes.ToString());
          

JavaScript Code:

var client = new WindowsAzure.MobileServiceClient('https://ramadantimeservice.azure-mobile.net', '&tl;API_KEY>');

client.invokeApi('Ramadan', {
  method: 'GET',
  parameters: {
    year: 2015,
    month: 06,
    day: 15,
    latitude: 21.4200,
    longitude: 39.8300,
    timeZone: +3,
    dayLightSaving: false,
    calcMethod: 4,
    asrJurisdiction: 0
  }
}).done(function (results) {
  var requests = JSON.parse(results.response);
  console.log(requests.suhoor);
  console.log(requests.iftaar);
}, function (error) {
  console.log(error);
});

client.invokeApi('Prayer', {
  method: 'GET',
  parameters: {
    year: 2015,
    month: 06,
    day: 15,
    latitude: 21.4200,
    longitude: 39.8300,
    timeZone: +3,
    dayLightSaving: false,
    calcMethod: 4,
    asrJurisdiction: 0
  }
}).done(function (results) {
  var requests = JSON.parse(results.response);
  console.log(requests.fajr);
  console.log(requests.dhuhr);
  console.log(requests.asr);
  console.log(requests.maghrib);
  console.log(requests.isha);
}, function (error) {
  console.log(error);
});