Prayer API API Reference

This app exposes a simple web API for querying prayer times (in the islamic tradition) by space and time.

See an example of the deployed app here .

This app leverages the praytimes.org project to cacluate prayer times. It is worth noting that the version of the praytimes.org library used here requires a patch due to a python scope issue (not sure how to push that patch back upstream, the project seems largely abandoned).

This app is built and tested with Python3.6 and deployed to AWS Lambda using the Serverless Framework through Travis CI. We use Codeclimate to keep track of maintainability and test coverage.

There are currently no limitations on API usage on the /prod endpoint, which is CORS enabled (therefore, possible to use with frontend javascript). This policy will remain if and until there is a good reason to restrict usage.

API Endpoint
https://8ldbpgh8mh.execute-api.us-east-1.amazonaws.com/prod
Schemes: https
Version: 1.0.0

Paths

/location/{lat}/{lng}

GET /location/{lat}/{lng}

Get prayertimes for (lat, lng) by date

date
in query
int now

date as unix timestamp
ex. 1527249151

calc-method
in query
string ISNA

method to use for calculating prayer times

ex. MWL, ISNA, Egypt, Makkah, Karachi, Tehran, Jafari

time-format
in query
string 12h

how to format times

ex. 12h, 24h

200 OK

Prayer object in response

400 Bad Request

Failure message in response

type
object
Response Content-Types: application/json
Response Example (200 OK)
{
  "imsak": "string",
  "fajr": "string",
  "sunrise": "string",
  "dhuhr": "string",
  "asr": "string",
  "sunset": "string",
  "maghrib": "string",
  "isha": "string",
  "midnight": "string"
}
Response Example (400 Bad Request)
{
  "statusCode": "400",
  "body": "error message"
}

Schema Definitions

Prayers: object

imsak: string
fajr: string
sunrise: string
dhuhr: string
asr: string
sunset: string
maghrib: string
isha: string
midnight: string
Example
{
  "imsak": "string",
  "fajr": "string",
  "sunrise": "string",
  "dhuhr": "string",
  "asr": "string",
  "sunset": "string",
  "maghrib": "string",
  "isha": "string",
  "midnight": "string"
}