0
Answered

Saturdays show information from friday?

HebcalUser25 2 years ago updated by Michael J. Radwin 2 years ago 3

Hi, once again thanks for the great API!

I use the API to update a calendar once a day using a simple microcontroller. By making a request once a day I hope to retreive the most actual data for that day (the earlier caching 'problem' seem to have resolved that).

This now does seem to work except for the saturdays, I've noticed that on the saturdays it will also include the previous friday candle lighting time.

Even when I specify the specific day to just the saturday like: gy=2022&gm=9&gd=10, I will still receive data from the day before. It only seems to do this on the saturdays.

Example URL: https://www.hebcal.com/shabbat?cfg=json&b=18&gy=2022&gm=9&gd=10

It feels like this is done on purpose, but I might be wrong. Is there any reason why this happens? And is there a way to overrule it?

Thanks for any help.

Answer

Answer
Answered

Hi, quick response: yes, indeed, this is by design. The Shabbat API always displays both Friday and Saturday, even if Friday has already passed.

No, there is no way to change this behavior.

If you want more control over date ranges use our Jewish calendar API and specify start and end parameters. The returned JSON is nearly identical to the Shabbat API so it should be easy to transition to this alternate API

https://www.hebcal.com/home/195/jewish-calendar-rest-api

Thanks, got it! I've implemented some logic into my code that now fetches time from the internet and then compares it to the JSON item dates from Hebcal, if the date is not in the future, it moves on to the next item. 

What is actually the difference between the Jewish calendar API and the Shabbat API? Both seem to return Jewish Holidays, Candle Lighting times and Havdalah times. Or is it just the more parameter control options?

Glad you got it working.


Yes, the major difference is parameters to control options. The Shabbat API attempts to keep things extremely simple (which means less flexibility). The Jewish calendar API is much more full-featured.

Answer
Answered

Hi, quick response: yes, indeed, this is by design. The Shabbat API always displays both Friday and Saturday, even if Friday has already passed.

No, there is no way to change this behavior.

If you want more control over date ranges use our Jewish calendar API and specify start and end parameters. The returned JSON is nearly identical to the Shabbat API so it should be easy to transition to this alternate API

https://www.hebcal.com/home/195/jewish-calendar-rest-api