Prayer Times API

This API lets you fetch daily prayer times from Presidency of Religious Affairs of Turkey (Diyanet İşleri Başkanlığı) in a nice, clean format. You can use it to find a location with available prayer times info, then query the schedule of that month's prayer times.

I've created this API to prepare for a web app I'll be building soon. I am planning to structure it as a progressive web app that can be easily installed and even planning to add push notifications to let user know of upcoming prayers.

Swagger documentation for the API is reachable at prayertimes.api.abdus.dev/docs

Usage

  1. Find a location first by narrowing down country > city > region to get a location id. Or search by country / state / city name:
curl "https://prayertimes.api.abdus.dev/api/diyanet/search?q=istanbul"

You'll get a list of locations:

[
  ...
  {
    "id": 9541,
    "country": "TÜRKİYE",
    "city": "İSTANBUL",
    "region": "İSTANBUL"
  },
  {
    "id": 9547,
    "country": "TÜRKİYE",
    "city": "İSTANBUL",
    "region": "ŞİLE"
  }
]
  1. Using the location id fetch the schedule of prayer times
curl "https://prayertimes.api.abdus.dev/api/diyanet/prayertimes?location_id=9541"

you'll get a json like this:

[
  {
    "date": "2020-01-21T00:00:00",
    "fajr": "06:48",
    "sun": "08:17",
    "dhuhr": "13:20",
    "asr": "15:50",
    "maghrib": "18:13",
    "isha": "19:37"
  },
  {
    "date": "2020-01-22T00:00:00",
    "fajr": "06:47",
    "sun": "08:17",
    "dhuhr": "13:20",
    "asr": "15:51",
    "maghrib": "18:14",
    "isha": "19:38"
  },
  ...
]