0
Not a bug

API not working anymore?

borux 3 years ago updated by Michael J. Radwin 3 years ago 3

for many cities the API is not working anymore,
for example
https://www.hebcal.com/hebcal?v=1&cfg=json&maj=on&min=on&mod=off&nx=on&year=now&month=x&ss=on&mf=on&c=off&geo=city&city=DE-Stuttgart&s=on&lg=en&d=on&o=on&i=off
one more is Strasbourg, but there are more of them,
will you do something with that, or will it stay that way?

Answer

Answer
Not a bug

Hi, thanks for using Hebcal API. We're sorry to hear that you are having difficulty getting API results for Stuttgart and Strasbourg.

You can use URLs like these to get Shabbat times for these cities.

Stuttgart, Baden-Wuerttemberg, Germany

https://www.hebcal.com/hebcal?cfg=json&v=1&geo=geoname&geonameid=2825297&b=18&M=on&lg=a&year=now&c=on&s=on&maj=on&min=on&mod=on&mf=on&ss=on&nx=on

Strasbourg, Grand Est, France

https://www.hebcal.com/hebcal?cfg=json&v=1&geo=geoname&geonameid=2973783&b=18&M=on&lg=a&year=now&c=on&s=on&maj=on&min=on&mod=on&mf=on&ss=on&nx=on

Please note that the preferred way to access world cities is to use the GeoNames IDs as we've done above.


The following options are available for our APIs:

  • geo=geoname – location specified by GeoNames.org numeric ID
    • requires additional parameter geonameid=3448439
    • Hebcal.com supports approximately 47,000 different GeoNames IDs. These are cities with a population of 5000+. See cities5000.zip from https://download.geonames.org/export/dump/.
  • geo=zip – location specified by United States ZIP code
    • requires additional parameter zip=90210
  • geo=city – location specified by one of the Hebcal.com legacy city identifiers
    • requires additional parameter city=GB-London
  • geo=pos – location specified by latitude, longitude, and timezone. Requires additional 3 parameters:
    • latitude=[-90.0 to 90.0] – latitude in decimal format (e.g. 31.76904 or -23.5475)
    • longitude=[-180.0 to 180.0] – longitude decimal format (e.g. 35.21633 or -46.63611)
    • tzid=TimezoneIdentifier. See List of tz database time zones. Be sure to use the “TZ database name” such as America/New_York or Europe/Paris, not a UTC offset

 It was working this way (geo=city&city=DE-Stuttgart) for two years for thousands of cities, and now it's not.
Why this happened?
Please bring back this functionalit,
other way i have to rewrite a lot of code

Hi, we're so sorry, but we are pretty certain that DE-Stuttgart or FR-Strasbourg have never worked. We can't find those references anywhere in our code.

We do support a small number (approximately 500) of legacy city names (e.g. geo=city&city=DE-Munich) but we haven't updated that list in over 4 years. That list does not contain thousands of cities, nor does it contain DE-Stuttgart or FR-Strasbourg

https://github.com/hebcal/dotcom/blob/v1.1/hebcal.com/dist/cities2.txt

I hope this information helps.

Shabbat Shalom!

Answer
Not a bug

Hi, thanks for using Hebcal API. We're sorry to hear that you are having difficulty getting API results for Stuttgart and Strasbourg.

You can use URLs like these to get Shabbat times for these cities.

Stuttgart, Baden-Wuerttemberg, Germany

https://www.hebcal.com/hebcal?cfg=json&v=1&geo=geoname&geonameid=2825297&b=18&M=on&lg=a&year=now&c=on&s=on&maj=on&min=on&mod=on&mf=on&ss=on&nx=on

Strasbourg, Grand Est, France

https://www.hebcal.com/hebcal?cfg=json&v=1&geo=geoname&geonameid=2973783&b=18&M=on&lg=a&year=now&c=on&s=on&maj=on&min=on&mod=on&mf=on&ss=on&nx=on

Please note that the preferred way to access world cities is to use the GeoNames IDs as we've done above.


The following options are available for our APIs:

  • geo=geoname – location specified by GeoNames.org numeric ID
    • requires additional parameter geonameid=3448439
    • Hebcal.com supports approximately 47,000 different GeoNames IDs. These are cities with a population of 5000+. See cities5000.zip from https://download.geonames.org/export/dump/.
  • geo=zip – location specified by United States ZIP code
    • requires additional parameter zip=90210
  • geo=city – location specified by one of the Hebcal.com legacy city identifiers
    • requires additional parameter city=GB-London
  • geo=pos – location specified by latitude, longitude, and timezone. Requires additional 3 parameters:
    • latitude=[-90.0 to 90.0] – latitude in decimal format (e.g. 31.76904 or -23.5475)
    • longitude=[-180.0 to 180.0] – longitude decimal format (e.g. 35.21633 or -46.63611)
    • tzid=TimezoneIdentifier. See List of tz database time zones. Be sure to use the “TZ database name” such as America/New_York or Europe/Paris, not a UTC offset