Git Product home page Git Product logo

api.aladhan.com's People

Contributors

cpfair avatar dependabot[bot] avatar meezaan avatar ramialkaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

api.aladhan.com's Issues

limited API

are API calls unlimited and free, if yes then why I am getting this message
{"message":"API rate limit exceeded"}
if it's not free then where are the pricing options?

Prayer times as date objects

Salaam!
It would be great if the prayer times could also be returned as date objects.

Currently they are returned just as a string. The problem comes with midnight, whereby the time could be before 12AM or after, and even as late as 1am. This causes issues with countdown as it thinks midnight is today at AM instead of tomorrow.

Ideally we would have returned for prayer times today:

August 03, 2021 5:20AM (fajr)
...
August 03, 2021 8:20PM (for isha)
August 04, 2021 1:20AM (for midnight)

Thanks!

Calculation Custom Method Not Working

Prayer times differ between timingsByCity and calendarByCity

While looking to integrate your amazing API in a small tool I'm working on, I noticed a discrepency between timingsByCity and calendarByCity.

For the city I'm checking on (Dubai, AE) the difference is in the Duhr, Sunset and Maghrib. I haven't checked any other cities.

As I write this on 2023-04-02 the following is what is return by https://api.aladhan.com/v1/timingsByCity?city=Dubai&country=AE:

{
    "code": 200,
    "status": "OK",
    "data": {
        "timings": {
            "Fajr": "04:52",
            "Sunrise": "06:10",
            "Dhuhr": "12:26",
            "Asr": "15:51",
            "Sunset": "18:39",
            "Maghrib": "18:39",
            "Isha": "19:54",
            "Imsak": "04:42",
            "Midnight": "00:23",
            "Firstthird": "22:27",
            "Lastthird": "02:18"
        },
        "date": {
            "readable": "02 Apr 2023",
            "timestamp": "1680404400",
            "hijri": {
                "date": "11-09-1444",
                "format": "DD-MM-YYYY",
                "day": "11",
                "weekday": {
                    "en": "Al Ahad",
                    "ar": "الاحد"
                },
                "month": {
                    "number": 9,
                    "en": "Ramaḍān",
                    "ar": "رَمَضان"
                },
                "year": "1444",
                "designation": {
                    "abbreviated": "AH",
                    "expanded": "Anno Hegirae"
                },
                "holidays": []
            },
            "gregorian": {
                "date": "02-04-2023",
                "format": "DD-MM-YYYY",
                "day": "02",
                "weekday": {
                    "en": "Sunday"
                },
                "month": {
                    "number": 4,
                    "en": "April"
                },
                "year": "2023",
                "designation": {
                    "abbreviated": "AD",
                    "expanded": "Anno Domini"
                }
            }
        },
        "meta": {
            "latitude": 25.080209,
            "longitude": 55.283596,
            "timezone": "Asia/Dubai",
            "method": {
                "id": 16,
                "name": "Dubai (experimental)",
                "params": {
                    "Fajr": 18.2,
                    "Isha": 18.2
                },
                "location": {
                    "latitude": 25.0762677,
                    "longitude": 55.087404
                }
            },
            "latitudeAdjustmentMethod": "ANGLE_BASED",
            "midnightMode": "STANDARD",
            "school": "STANDARD",
            "offset": {
                "Imsak": 0,
                "Fajr": 0,
                "Sunrise": 0,
                "Dhuhr": 3,
                "Asr": 0,
                "Maghrib": 3,
                "Sunset": 3,
                "Isha": 0,
                "Midnight": 0
            }
        }
    }
}

However the same date in the calendarByCity shows different prayer times (and dones't have automatic adjustments).
URI: https://api.aladhan.com/v1/calendarByCity?city=Dubai&country=AE&month=04&year=2023
Relevant part of the result:

{
    "code": 200,
    "status": "OK",
    "data": [
        { ...
        },
        {
            "timings": {
                "Fajr": "04:52 (+04)",
                "Sunrise": "06:10 (+04)",
                "Dhuhr": "12:23 (+04)",
                "Asr": "15:51 (+04)",
                "Sunset": "18:36 (+04)",
                "Maghrib": "18:36 (+04)",
                "Isha": "19:54 (+04)",
                "Imsak": "04:42 (+04)",
                "Midnight": "00:23 (+04)",
                "Firstthird": "22:27 (+04)",
                "Lastthird": "02:18 (+04)"
            },
            "date": {
                "readable": "02 Apr 2023",
                "timestamp": "1680411661",
                "gregorian": {
                    "date": "02-04-2023",
                    "format": "DD-MM-YYYY",
                    "day": "02",
                    "weekday": {
                        "en": "Sunday"
                    },
                    "month": {
                        "number": 4,
                        "en": "April"
                    },
                    "year": "2023",
                    "designation": {
                        "abbreviated": "AD",
                        "expanded": "Anno Domini"
                    }
                },
                "hijri": {
                    "date": "11-09-1444",
                    "format": "DD-MM-YYYY",
                    "day": "11",
                    "weekday": {
                        "en": "Al Ahad",
                        "ar": "الاحد"
                    },
                    "month": {
                        "number": 9,
                        "en": "Ramaḍān",
                        "ar": "رَمَضان"
                    },
                    "year": "1444",
                    "designation": {
                        "abbreviated": "AH",
                        "expanded": "Anno Hegirae"
                    },
                    "holidays": []
                }
            },
            "meta": {
                "latitude": 25.080209,
                "longitude": 55.283596,
                "timezone": "Asia/Dubai",
                "method": {
                    "id": 16,
                    "name": "Dubai (experimental)",
                    "params": {
                        "Fajr": 18.2,
                        "Isha": 18.2
                    },
                    "location": {
                        "latitude": 25.0762677,
                        "longitude": 55.087404
                    }
                },
                "latitudeAdjustmentMethod": "ANGLE_BASED",
                "midnightMode": "STANDARD",
                "school": "STANDARD",
                "offset": {
                    "Imsak": 0,
                    "Fajr": 0,
                    "Sunrise": 0,
                    "Dhuhr": 0,
                    "Asr": 0,
                    "Maghrib": 0,
                    "Sunset": 0,
                    "Isha": 0,
                    "Midnight": 0
                }
            }
        },
        {
            ...
        }
    ]
}

Shouldn't both endpoints be returning the same data or am I missing something?

Add Cache Control Header to Response

I have come across instances where a website calls the API each time a user visits it. Ideally the API should be called once per day for each user. If we take in lat/long only up to 3 decimal digits this should become possible.

A server response — we could make smaller JSON

Each request generates calculations for a given month.
By this case if we have sent request in 29th of October, it responses with JSON, where a praying times starts with a month ago useless date. By this way we have got ≈50Kb unnecessary lines of JSON instead 2-3Kb actual data.
We need a method, where sender can set number of days, in which he needs to get prayer dates. For example it can be
&data=%number of the days%
for getting JSON table, where calculation starts from today and ends after given numbers day.
I also suggest that if user send query without &data='...' parameter, by default server returns info for today calculations only.

Send improvements upstream?

Impressive website and work, but I was wondering if there was an available list of improvements that have been made to the original code at http://praytimes.org?

I want to use the Python code, but it hasn't been updated there in years. I'll be happy to port over and make available any improvements you've made if there's a clear list of them?

Inconsistent day between play and v1 timingsByCity

The following URL displays day as 17

https://aladhan.com/play/Corvallis/OR,%20USA 

image

whereas the API returns 16

http://api.aladhan.com/v1/timingsByCity?city=Corvallis&country=USA&method=2

image

What am I missing?

BTW, where is the source for /play/ located ?

Thank you.

Service is unstable

First of all, thank you so much for such a great service, I am using it 5 times a day in my smart home, Barak allahu feek :)
For the last week or so, the service is totally unstable, mainly I get HttpResponseException: forbidden, and other times I get unreachable and other types of error.

Allow Hijri Date Adjustment

This needs to be allowed in a way so that the actual calendar calculation does not fall back a whole day, but just the actual date gets adjusted.

Missing Ramadan days with adjustment

The Hijri calendar in the calendar endpoint is not correct.
1st day of Ramadan should be on April 2nd, however it's on April 4th.

I used the adjustment=2 param to get Ramadan 1st to be on April 2nd. But Ramadan 2nd was missing from the response. It jumps directly from Ramadan 1st to Ramadan 3rd. So now instead of April 3rd being Ramadan 2nd, it's Ramadan 3rd.

Endpoint: https://api.aladhan.com/v1/calendar
Params:
latitude: 41.017153708870126
longitude: 28.977153766843355
method: 13
month: 4
adjustment: 2

Full route:
https://api.aladhan.com/v1/calendar?latitude=41.017153708870126&longitude=28.977153766843355&method=13&month=4&iso8601=true&adjustment=2

Response: (Ramadan 2nd is missing):

{
  "code": 200,
  "status": "OK",
  "data": [
    {
      "timings": {
        "Fajr": "2022-04-01T05:14:00+03:00 (+03)",
        "Sunrise": "2022-04-01T06:48:00+03:00 (+03)",
        "Dhuhr": "2022-04-01T13:08:00+03:00 (+03)",
        "Asr": "2022-04-01T16:42:00+03:00 (+03)",
        "Sunset": "2022-04-01T19:29:00+03:00 (+03)",
        "Maghrib": "2022-04-01T19:29:00+03:00 (+03)",
        "Isha": "2022-04-01T20:58:00+03:00 (+03)",
        "Imsak": "2022-04-01T05:04:00+03:00 (+03)",
        "Midnight": "2022-04-02T01:08:00+03:00 (+03)"
      },
      "date": {
        "readable": "01 Apr 2022",
        "timestamp": "1648792861",
        "gregorian": {
          "date": "01-04-2022",
          "format": "DD-MM-YYYY",
          "day": "01",
          "weekday": {
            "en": "Friday"
          },
          "month": {
            "number": 4,
            "en": "April"
          },
          "year": "2022",
          "designation": {
            "abbreviated": "AD",
            "expanded": "Anno Domini"
          }
        },
        "hijri": {
          "date": "30-08-1443",
          "format": "DD-MM-YYYY",
          "day": "30",
          "weekday": {
            "en": "Al Juma'a",
            "ar": "\u0627\u0644\u062c\u0645\u0639\u0629"
          },
          "month": {
            "number": 8,
            "en": "Sha\u02bfb\u0101n",
            "ar": "\u0634\u064e\u0639\u0652\u0628\u0627\u0646"
          },
          "year": "1443",
          "designation": {
            "abbreviated": "AH",
            "expanded": "Anno Hegirae"
          },
          "holidays": []
        }
      },
      "meta": {
        "latitude": 41.017153708870126,
        "longitude": 28.977153766843355,
        "timezone": "Europe\/Istanbul",
        "method": {
          "id": 13,
          "name": "Diyanet \u0130\u015fleri Ba\u015fkanl\u0131\u011f\u0131, Turkey",
          "params": {
            "Fajr": 18,
            "Isha": 17
          },
          "location": {
            "latitude": 39.9333635,
            "longitude": 32.8597419
          }
        },
        "latitudeAdjustmentMethod": "ANGLE_BASED",
        "midnightMode": "STANDARD",
        "school": "STANDARD",
        "offset": {
          "Imsak": 0,
          "Fajr": 0,
          "Sunrise": 0,
          "Dhuhr": 0,
          "Asr": 0,
          "Maghrib": 0,
          "Sunset": 0,
          "Isha": 0,
          "Midnight": 0
        }
      }
    },
    {
      "timings": {
        "Fajr": "2022-04-02T05:12:00+03:00 (+03)",
        "Sunrise": "2022-04-02T06:46:00+03:00 (+03)",
        "Dhuhr": "2022-04-02T13:08:00+03:00 (+03)",
        "Asr": "2022-04-02T16:42:00+03:00 (+03)",
        "Sunset": "2022-04-02T19:30:00+03:00 (+03)",
        "Maghrib": "2022-04-02T19:30:00+03:00 (+03)",
        "Isha": "2022-04-02T20:59:00+03:00 (+03)",
        "Imsak": "2022-04-02T05:02:00+03:00 (+03)",
        "Midnight": "2022-04-03T01:08:00+03:00 (+03)"
      },
      "date": {
        "readable": "02 Apr 2022",
        "timestamp": "1648879261",
        "gregorian": {
          "date": "02-04-2022",
          "format": "DD-MM-YYYY",
          "day": "02",
          "weekday": {
            "en": "Saturday"
          },
          "month": {
            "number": 4,
            "en": "April"
          },
          "year": "2022",
          "designation": {
            "abbreviated": "AD",
            "expanded": "Anno Domini"
          }
        },
        "hijri": {
          "date": "01-09-1443",
          "format": "DD-MM-YYYY",
          "day": "01",
          "weekday": {
            "en": "Al Sabt",
            "ar": "\u0627\u0644\u0633\u0628\u062a"
          },
          "month": {
            "number": 9,
            "en": "Rama\u1e0d\u0101n",
            "ar": "\u0631\u064e\u0645\u064e\u0636\u0627\u0646"
          },
          "year": "1443",
          "designation": {
            "abbreviated": "AH",
            "expanded": "Anno Hegirae"
          },
          "holidays": [
            "1st Day of Ramadan"
          ]
        }
      },
      "meta": {
        "latitude": 41.017153708870126,
        "longitude": 28.977153766843355,
        "timezone": "Europe\/Istanbul",
        "method": {
          "id": 13,
          "name": "Diyanet \u0130\u015fleri Ba\u015fkanl\u0131\u011f\u0131, Turkey",
          "params": {
            "Fajr": 18,
            "Isha": 17
          },
          "location": {
            "latitude": 39.9333635,
            "longitude": 32.8597419
          }
        },
        "latitudeAdjustmentMethod": "ANGLE_BASED",
        "midnightMode": "STANDARD",
        "school": "STANDARD",
        "offset": {
          "Imsak": 0,
          "Fajr": 0,
          "Sunrise": 0,
          "Dhuhr": 0,
          "Asr": 0,
          "Maghrib": 0,
          "Sunset": 0,
          "Isha": 0,
          "Midnight": 0
        }
      }
    },
    {
      "timings": {
        "Fajr": "2022-04-03T05:10:00+03:00 (+03)",
        "Sunrise": "2022-04-03T06:45:00+03:00 (+03)",
        "Dhuhr": "2022-04-03T13:07:00+03:00 (+03)",
        "Asr": "2022-04-03T16:43:00+03:00 (+03)",
        "Sunset": "2022-04-03T19:31:00+03:00 (+03)",
        "Maghrib": "2022-04-03T19:31:00+03:00 (+03)",
        "Isha": "2022-04-03T21:00:00+03:00 (+03)",
        "Imsak": "2022-04-03T05:00:00+03:00 (+03)",
        "Midnight": "2022-04-04T01:08:00+03:00 (+03)"
      },
      "date": {
        "readable": "03 Apr 2022",
        "timestamp": "1648965661",
        "gregorian": {
          "date": "03-04-2022",
          "format": "DD-MM-YYYY",
          "day": "03",
          "weekday": {
            "en": "Sunday"
          },
          "month": {
            "number": 4,
            "en": "April"
          },
          "year": "2022",
          "designation": {
            "abbreviated": "AD",
            "expanded": "Anno Domini"
          }
        },
        "hijri": {
          "date": "03-09-1443",
          "format": "DD-MM-YYYY",
          "day": "03",
          "weekday": {
            "en": "Al Ahad",
            "ar": "\u0627\u0644\u0627\u062d\u062f"
          },
          "month": {
            "number": 9,
            "en": "Rama\u1e0d\u0101n",
            "ar": "\u0631\u064e\u0645\u064e\u0636\u0627\u0646"
          },
          "year": "1443",
          "designation": {
            "abbreviated": "AH",
            "expanded": "Anno Hegirae"
          },
          "holidays": []
        }
      },
      "meta": {
        "latitude": 41.017153708870126,
        "longitude": 28.977153766843355,
        "timezone": "Europe\/Istanbul",
        "method": {
          "id": 13,
          "name": "Diyanet \u0130\u015fleri Ba\u015fkanl\u0131\u011f\u0131, Turkey",
          "params": {
            "Fajr": 18,
            "Isha": 17
          },
          "location": {
            "latitude": 39.9333635,
            "longitude": 32.8597419
          }
        },
        "latitudeAdjustmentMethod": "ANGLE_BASED",
        "midnightMode": "STANDARD",
        "school": "STANDARD",
        "offset": {
          "Imsak": 0,
          "Fajr": 0,
          "Sunrise": 0,
          "Dhuhr": 0,
          "Asr": 0,
          "Maghrib": 0,
          "Sunset": 0,
          "Isha": 0,
          "Midnight": 0
        }
      }
    },
//...

When I do adjustment=1, Ramadan 1st is missing from the response, but I'm able to have April 3rd correspond to Ramadan 2nd.

But in any case, ideally I would want the adjustment param to be stable so I can ship the app and not have to upload a new build to change it.

state or region parameter to timingsByCity is not recognized or validated correctly

Is "region" a recognized parameter in the URL? it's not in the docs at.
https://aladhan.com/prayer-times-api#GetTimingsByCity

image

The API does not complain about unknown parameters like foo=CA however documented parameter state=CA is not accepted either but state=California is accepted.

http://api.aladhan.com/v1/timingsByCity?city=los%20angeles&state=CA&country=USA&method=2
also NOT accepted the following

http://api.aladhan.com/v1/timingsByCity?city=Corvallis&state=Oregon&country=USA&method=2

http://api.aladhan.com/v1/timingsByCity?city=Corvallis&state=OR&country=USA&method=2

image

Thank you.

Tune setting not working when using a custom method

Assalmou Alaykoum,

When using a custom calculation method with tune parameter, tune parameter is not taken into account and simply ignored.

For example :

https://api.aladhan.com/timingsByAddress?address=London, UK&method=99&methodSettings=18.5,null,17.5&tune=1,2,3,4,5

image

If we chose a non custom calculation method, tune parameter is working well :

https://api.aladhan.com/timingsByAddress?address=London, UK&method=3&methodSettings=18.5,null,17.5&tune=1,2,3,4,5

image

BR,
Hicham.

Redo date calculations with IntlDateTimeFormatter

Like this example:

$DateTime = new DateTime();
$IntlDateFormatter = new IntlDateFormatter(
                    'en_US@calendar=islamic-civil', // or islamic
                    IntlDateFormatter::FULL,
                    IntlDateFormatter::FULL,
                    'Asia/Tehran',
                    IntlDateFormatter::TRADITIONAL);

echo $IntlDateFormatter->format($DateTime);

API does no longer returns yearly prayer times

The previous API used to take annual=true to return all 12 months in a year of prayer times.

The option seems to have been removed and the documentation says that if you omit the "month" option, it will be equivalent.

However, removing both "annual=true" and "month" seems to be equivalent to "month=1".

I can't find a way to return prayer times for full year as it used to work before.

JSON returned by API endpoint v1 timingsByCity is not matching the demo app play link

For March 11 2023 The "play" link Fajr time is displayed as 5:13 am which matches expectation

https://aladhan.com/play/Corvallis/OR,%20USA
image

However, I am invoking the timingsByCity with the following code:

let URL = `https://api.aladhan.com/v1/timingsByCity?country=${Country}&region=${Region}&city=${City}&method=${Method}&adjustment=${HijriCorrection}`
this.Load(URL)

actual request...

https://api.aladhan.com/v1/timingsByCity?country=US&region=Oregon&city=Corvallis&method=2&adjustment=1

and I get the following JSON with Fajr time as 5:00 am

image

what parameter(s) am I missing to match the timings displayed in the play link?
Also, I don't see a parameter regarding whether to use the system time or cloud time? if that matters?
Thank you.

Getting status code 429 often

Hi,
First of all, Thanks for this great product.
Secondly, I am using api.aladhan.com to get the timings of namaz in my project and often i get status code 429.
So my question is what is Maximum requests per minute set in api.aladhan.com server?
And can it be increased?

Not working for about 3 days now

I'm developing an android app that uses this API as the core requirement and now, the app has been developed but for 3 days I'm getting Forbidden (500) and sometimes even Not Found (403) errors but the main issue is that this happens through my app, and not through the browser. I'm so thankful for this API but now I see there was the same issue reported by someone about a week ago so, should I keep using the API or look for alternative solutions?

Return country & city information in addition to coordinates

Since the project uses Google Maps API for the geocoding, it would be useful to also get the country and city data in the response alongside the coordinates currently being returned.

When getting times by coordinates (geolocation API), I need to additionally reverse geocode the coordinates in order to know what city the times are for. It'd be great to have the available directly from the response.

Thanks!

api down

It seems that the api is down. Duplicate of #59

Fix Tawara, KI queries

Google is able to give co-ordinates for the above location, but fails to return the timezone.

So, https://maps.googleapis.com/maps/api/timezone/json?location=1.4518171,172.9716617&timestamp=1510733996 returns ZERO_RESULTS.

I've commented on an existing issue on the Google Issue Tracker https://issuetracker.google.com/issues/35830014 to raise this.

Until they fix it, we need to mark this as an invalid location in the citySanitizer temporarily is it makes hundreds of calls to the Google Maps API.

No such file or directory in /var/www/config/init.php

I couldn't use this project.
It runned but not worked for me.
I faced this issue when i send a request to localhost:7070 (aa-app)
require_once(/var/www/config/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/config/init.php on line 8

Huge difference between city = doha & city = douha

Hello, for a given date 01 / 01 / 2024 could you please check why

https://api.aladhan.com/v1/calendarByCity/2024?city=douha&country=qatar&method=18

returns -> "Fajr": "07:03 (+01)",

AND

https://api.aladhan.com/v1/calendarByCity/2024?city=doha&country=qatar&method=18

returns -> "Fajr": "04:58 (+03)",

the difference between doha & douha which are they both the same place is around 2 hours doesn't make any sense!

Thanks 🌹

Config Updates

  • Load Yaml just once
  • Move display errors to yaml
  • Also use as DI for memcache object

ISO 8061 format is wrong?

I'm using the following endpoint
https://api.aladhan.com/v1/calendarByCity?city=Jeddah&country=SA&iso8601=true

When I try to parse it in Golang get the following error
panic: parsing time "\"2023-01-01T05:40:00+03:00 (+03)\"" as "\"2006-01-02T15:04:05Z07:00\"": cannot parse " (+03)\"" as "\""

After removing the (+03) part in the end, it works as intended

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.