Posted by & filed under Developers, APIs, RSS Feeds, Source Code.

Much like our full Jewish calendar REST API, we offer a simple API for getting just this week’s Shabbat times and Torah Portion. Two output formats are supported: JSON and RSS.

The basic URL format is as follows:

http://www.hebcal.com/shabbat/?cfg=json&geonameid=3448439&m=50

Note the following customizable parameters and their meanings:

  • cfg=json – output format is JSON (cfg=json) or RSS (cfg=r)
  • m=50 – Havdalah 50 minutes after sundown. Set to m=0 (zero) to disable Havdalah times
  • b=18 – Candle-lighting time minutes before sunset
  • a=off – use Sephardic (a=off) or Ashkenazis transliterations (a=on)

You must specify a location for candle-lighting times:

  • 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 http://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 to 90] – latitude in decimal format (e.g. 31.76904 or -23.5475)
    • longitude=[-180 to 180] – longitude decimal format (e.g. 35.21633 or -46.63611)
    • tzid=TimezoneIdentifier (See List of tz database time zones)

And example output looks like this: