prayertimes-api

About

This project was created to support Ulemaa, researchers and islamic institutions in their efforts to standardize and unify prayer times calculation according to Islamic law and the related cosmic phenomena. It is particularly intended to provide a better understanding of the inner workings of the different calculation methods and parameters and how they lead to the resulting prayer times.

This project is subject to continuous improvement and refinement. Any ideas, suggestions or feedback are highly welcomed.

Also, if you are interested to contribute to the code base (JavaScript), please get in touch.

Important Notice

This tool is solely for the purpose of research to be used by qualified researchers only. It is not ment to be used for performing Ibadaat. Please keep in mind that the matter of prayer times belongs to the domain of Fuqahaa' and has to be approved by respective Fiqh Councils. Therefore, regardless of the precision and quality of given calculation algorithms, individualls shall not rely on any programms or given data sets to make their own prayer time calendars, but solely on decisions of qualified Ulema and Fiqh Councils.

Accessing the API

Visual Interface: https://prayertimes-research.vercel.com

Direct API access: https://prayertimes-api.herokuapp.com/

Configuration Parameters

Send a GET request to /parameters to retrieve a current set of configuration paramaters. Send an empty POST request to receive a JSON object with a calendar and a JSON configuration object. You can copy the latter and send it as a POST request with your desired configuration.

Example Request

curl --location --request POST 'https://prayertimes-api.herokuapp.com/' \ --header 'Content-Type: application/json' \ --data-raw '{ "latitude": 55.77957, "longitude": 6.07153, "observer_elevation": false, "year": "2024", "gmt_diff_hours": "0", "observe_dst": false, "dst_from_date": "2021-03-28T09:00:00.000Z", "dst_to_date": "2021-10-31T22:00:00.000Z", "dst_deviation": 1, "fajr_solar_altitude_angle": -18, "shuruq_solar_altitude_angle": -0.833333, "maghrib_solar_altitude_angle": -0.833333, "ishaa_solar_altitude_angle": -17, "ishaa_fixed_minutes_after_maghrib": false, "fajr_fixed_minutes_before_shuruq": false, "fajr_static_tamkin_minutes": -2, "shuruq_static_tamkin_minutes": -2, "zuhr_static_tamkin_minutes": 2, "assr_static_tamkin_minutes": 2, "maghrib_static_tamkin_minutes": 2, "ishaa_static_tamkin_minutes": 2, "assr_calculation": "Hanafi", "taqdir_method": "fixed", "taqdir_fixed_ishaa_minutes": 90, "taqdir_fixed_fajr_minutes": 90, "taqdir_ab_stable_latitude": 45, "taqdir_ab_absolute_if_no_maghrib_shuruq": false }'

Install Instructions

  1. Install Node JS on your PC/Mac/Linux https://nodejs.org/en/download/
  2. Clone this repository https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
  3. In terminal navigate to the repository folder
  4. run in your console: npm install
  5. run in your console: npm start will run on defautl port 8000

Running with Docker

npm install

# for development
docker compose up

# for production
docker compose -f docker-compose.prod.yml up