Welcome to Muezzin API web service!
This application provides Islamic prayer times for more than 200 countries, their cities and many of their districts. Data is read from Republic of Turkey, Presidency of Religious Affairs' website and provided in a simple JSON structure.
The application will be running at https://muezzin-staging.herokuapp.com.
Muezzin API application is developed using Play Framework and Scala. The application utilizes Akka Actors actors for scheduling jobs, WS for making HTTP requests, Firebase Realtime Database for data persistance and Errors for error handling.
Add host of your EB host to application.conf under play.filters.hosts.allowed
. Here's an example:
play {
filters.hosts {
allowed = [
"muezzin.123456.eu-west-1.elasticbeanstalk.com",
"muezzin.herokuapp.com",
"muezzin-staging.herokuapp.com",
"localhost:9000"
]
}
}
Then run sbt elastic-beanstalk:dist
to create ZIP file that you can upload to your ElasticBeanstalk.
Thanks @gokhanayhan38 for his help.
- All endpoints use
GET
method. - When a request is successful, response will be
200 OK
withapplication/json
asContent-Type
and the requested data in body. - When a request fails, response will be
503 SERVICE_UNAVAILABLE
withapplication/json
asContent-Type
and error data in body according to Errors.
{
"errors": [
{
"name": "requestFailed",
"reason": "Diyanet returned invalid content type.",
"data": "applocation/xml"
}
]
}
- Each object in
errors
array will correspond to a single error. There may be 1 or more error objects. name
will be provided for all types of errors whereasreason
anddata
might not be available for all errors.
GET: /countries
It returns available countries.
{
"countries": {
"2": {
"name": "Turkey",
"nameTurkish": "Türkiye",
"nameNative": "Türkiye"
}
}
}
- Every key in
countries
object is the id for the country in the value object. name
is the name of country in English.nameTurkish
is the name of the country in Turkish.nameNative
is the name of the country in their native language.
It returns available cities of given countryId
.
{
"cities": {
"540": {
"name": "İzmir"
}
}
}
- Every key in
cities
object is the id for the city in the value object. name
is the name of the city.
It returns available districts of given cityId
of countryId
. Please note that some cities might not have districts available.
{
"districts": {
"9552": {
"name": "Aliağa"
}
}
}
- Every key in
districts
object is the id for the district in the value object. name
is the name of the district.
It returns prayer times for a month belonging to given countryId
, cityId
and districtId
. Please note that there are no times available for past dates and more than 1 month future dates. Diyanet only provides 1 month of prayer times starting from current time. Therefore, it is client's responsibility to keep requested prayer times and request more whenever needed.