islamic-network / api.aladhan.com Goto Github PK
View Code? Open in Web Editor NEWThe AlAdhan API
License: GNU General Public License v3.0
The AlAdhan API
License: GNU General Public License v3.0
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?
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!
method=99&methodSettings=18.5%2Cnull%2C17.5 not working on these api calls
Prayer Times Calendar - http://api.aladhan.com/v1/calendar/:year/:month
Prayer Times Calendar by address - http://api.aladhan.com/v1/calendarByAddress/:year/:month
Prayer Times Calendar by city - http://api.aladhan.com/v1/calendarByCity/:year/:month
Prayer Times Hijri Calendar - http://api.aladhan.com/v1/hijriCalendar/:year/:month
Prayer Times Hijri Calendar by address - http://api.aladhan.com/v1/hijriCalendarByAddress/:year/:month
Prayer Times Hijri Calendar by city - http://api.aladhan.com/v1/hijriCalendarByCity/:year/:month
it only works on these api requests
Timings - http://api.aladhan.com/v1/timings/:date
Timings By Address - http://api.aladhan.com/v1/timingsByAddress/:date
Timings By City - http://api.aladhan.com/v1/timingsByCity/:date
It lists a timings example!
produces
offset: { Imsak: 0, Fajr: 0, Sunrise: 0, Dhuhr: 0, Asr: 0, Maghrib: 0, Sunset: 0, Isha: "30 min", Midnight: 0,
It should still honour the others, whilst always overwriting Isha to 30 mins.
I cannot access the aladhan site/api
is it down?
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?
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.
Add query parameter with iso8601=true to return the complete iso8601 format for prayer times.
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.
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?
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.
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.
Would you add an API for returning backgrounds?
How about Adhan Audio?
I understand this is not "core" data to the API but would you consider exposing these arrays anytime soon?
Thank you.
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
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.
Is "region" a recognized parameter in the URL? it's not in the docs at.
https://aladhan.com/prayer-times-api#GetTimingsByCity
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
Thank you.
Assalmou Alaykoum,
When using a custom calculation method with tune parameter, tune parameter is not taken into account and simply ignored.
For example :
If we chose a non custom calculation method, tune parameter is working well :
BR,
Hicham.
http://api.aladhan.com/v1/timingsByCity?city=los%20angeles®ion=CA&country=USA&method=2
returns JSON with Hijri date as Shaban 29th and we are Ramadhan 1st (Saturday April 2nd 2022) that's 2 days off.
Whereas the following calendar is correct how do we go about fixing the timingsByCity endpoint to return correct Hijri date?
https://aladhan.com/ramadan-prayer-times/2022/Los Angeles/CA, USA
Thank you.
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);
Add the Moonsighting.com calculation method for Fajr and Isha to the API.
2 separate endoints, one returning the calculation in degrees and the other a compass image.
Just like we have one for timingsByAddress to keep from people's code errors calling the Google Maps API
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.
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
However, I am invoking the timingsByCity with the following code:
let URL = `https://api.aladhan.com/v1/timingsByCity?country=${Country}®ion=${Region}&city=${City}&method=${Method}&adjustment=${HijriCorrection}`
this.Load(URL)
actual request...
and I get the following JSON with Fajr time as 5:00 am
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.
This is more of a request than an issue, please add Habous calculaion method (Morocco) trying to do a custom calculation or adding a time offset breaks the time accuracy of other days.
Here is the official Habous prayer times for reference.
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?
This should not contain a timezonestring reference - it has been added to the docs by mistake.
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?
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!
It seems that the api is down. Duplicate of #59
This is likely related to the code here: https://github.com/islamic-network/api.aladhan.com/blob/master/src/AlAdhanApi/Model/HijriCalendarService.php#L418.
Calling http://api.aladhan.com/v1/gToH?date=30-10-2019 or http://api.aladhan.com/v1/gToH?date=29-10-2019 returns the same Hijri date (01-03-1441), which is obviously incorrect. It should likely correspond to 30-10-2019, as http://api.aladhan.com/v1/hToG?date=01-03-1441 produces.
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×tamp=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.
Redirect all timings endpoints from timestamp to date so they can be cached.
This would be mean that the API would only actually calculate timings for one location once per day.
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
This must be:
/ramdan/calendar/2018
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 🌹
Check utf-8 encoding on city and address names before passing to geocoding API
When used with iso8601=true.
Reported @ https://discord.com/channels/547154927248736266/549920571270365195/874377018286960701
This must have instances of:
/ramadan/timings/2018
/ramadan/timingsByCity/2018
/ramadan/timingsByAddress/2018
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
السلام عليكم.
Would you, please, help me?
My site is: http://salyat.com/converter/
here's a code: https://gist.github.com/iamjenechka/73dcc438482d5ab6996cf136cc6f4829
and I got:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.aladhan.com/gToH?date=04-02-2024
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.