Skip to main content

Specifying a location for Jewish calendar APIs

Hebcal.com Web APIs allow the developer to specify a location using one of four options.

Location is used to estimate candle-lighting, Havdalah, fast start/end times, and other zmanim (halachic times). All of these times are derived from a solar position calculation, which are approximated from a location (latitude, longitude) and day of year.

Option 1: GeoNames

To specify a location using a GeoNames numeric ID, use the geonameid parameter, e.g. geonameid=3448439

The GeoNames geographical database covers all countries and contains over eleven million placenames that are available for download free of charge. Hebcal.com supports a subset of the full database: approximately 150,000 world cities with a population of 1,000 or more.

For a complete list of IDs that the Hebcal.com web APIs accept, download the cities1000.zip from https://download.geonames.org/export/dump/ and consider only rows with a type of P (inhabited place). Hebcal refreshes this database approximately once per year.

Option 2: United States ZIP code

To specify a location using a 5-digit ZIP code in the US, use the zip parameter, e.g. zip=90210

If a longer ZIP code (for example a ZIP+4) is specified, only the first 5 digits will be considered.

Hebcal licenses a commercial ZIP code database and we refresh this database approximately once per year.

Option 3: Latitude and Longitude

To specify a location using a latitude and longitude and timezone, use 3 required parameters and one optional parameter.

  1. latitude=[-90.0 to 90.0] – latitude in decimal format (e.g. 31.76904 or -23.5475)
  2. longitude=[-180.0 to 180.0] – longitude decimal format (e.g. 35.21633 or -46.63611)
  3. 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.

An optional parameter elev=[1-9000] may also be used to specify the elevation in meters. This parameter will be ignored unless ue=on, see below for further details.

Option 4: Legacy city identifier (deprecated)

To specify a location using one of ~400 Hebcal legacy city identifiers, use the city parameter, e.g. city=GB-London

You must use one of the legacy city identifiers. Case insensitive. This approach is generally deprecated, as we now recommend using geonameid instead.

Elevation

All of the above options can optionally utilize an elevation for sunset calculation. To enable elevation, specify ue=on (default off).

If on, use elevation to affect the calculation of all sunrise/sunset based zmanim. Note: there are some zmanim such as degree-based zmanim that are driven by the amount of light in the sky and are not impacted by elevation. These zmanim intentionally do not support elevation adjustment

Accuracy

For more information on the calculation engine, see How accurate are candle lighting times?

Jewish calendar event language support

The Hebcal website and APIs support 13 different languages for event titles. By default, Hebcal uses Sephardic transliterations. To transliterate event titles in a different language, specify lg=LANG parameter using one of the following values:

lg= Meaning
s Sephardic transliterations (default if unspecified)
a Ashkenazic transliterations
he Hebrew – עִברִית
he-x-NoNikud Hebrew (no nikud) – עברית
de German – Deutsch
es Spanish – Español
fr French – français
ru Russian – ру́сский язы́к
pl Polish – język polski
fi Finnish – Suomalainen
hu Hungarian – Magyar nyelv
ro Română – Romanian
ashkenazi_romanian Română (Ashk.) – Romanian (Ashk.)
uk українська – Ukrainian
sh Sephardic translit. + Hebrew
ah Ashkenazis translit. + Hebrew

For example, depending on which language is selected, the event title “Sukkot” will be transliterated as one of the following:

  • Soukkot
  • Sucos
  • Sucot
  • Sukkos
  • Sukkot
  • Sukot
  • Szukkot
  • Суккот
  • סוּכּוֹת
  • סוכות

Zmanim (halachic times) iCalendar feed

We are pleased to offer an experimental Zmanim (halachic times) iCalendar feed. Many calendar desktop, mobile or web apps support the iCalendar (.ICS file extension) format.

You can specify your location using a GeoNames.org numeric ID, a United States ZIP code, or a geographic position (location specified by latitude, longitude, and timezone). You’ll find details on how to specify the location parameters on the Zmanim (halachic times) API page.

By default, event titles use a Sephardic transliteration. Append &lg=LANG to the URL to render the events titles using an alternate event language.

Option 1: All zmanim in a single daily untimed event

The basic URL format of the feeds is this:

webcal://download.hebcal.com/zmanim2?geonameid=5368361

The calendar feed will contain zmanim for the next 90 days. There will be a single all-day (untimed) event with the Hebrew date, and the description/notes will contain all times. Here is an example event:

Option 2: Timed events

If you would prefer approximately 20 timed events per day, we offer an alternate feed format using this alternate URL format (note /zmanim instead of /zmanim2 above):

webcal://download.hebcal.com/zmanim?zip=02906

The calendar feed will contain events for the next 60 days. Each event represents only a single halachic time.

Here’s an example of the events included in the calendar feed:

Option 3: Sunrise and Sunset only

An alternate feed which contains only sunrise and sunset events is available using URL format like this (note /sunrs instead of /zmanim2 above):

webcal://download.hebcal.com/sunrs?zip=02906

In this variation, there are only two events per day.

Displaying today’s Omer count

If you’d like to display today’s Omer count on your website and you’re comfortable with a bit of Javascript, you can use a snippet like this:

To display the Omer count in another language, change the &lg=s to another supported language code (for example h for Hebrew, es for Spanish, etc).

If you’d like to display the long omer count in English or Hebrew, you can dislay item.omer.count.en or item.omer.count.he

  • he: “הַיוֹם שְׁמוֹנָה עָשָׂר יוֹם, שְׁהֵם שְׁנֵי שָׁבוּעוֹת וְאַרְבָּעָה יָמִים לָעוֹמֶר”,
  • en: “Today is 18 days, which is 2 weeks and 4 days of the Omer”

See also item.omer.sefira.he, .en, and .translit.

  • he: “נֶּֽצַח שֶׁבְּתִּפאֶרֶת”,
  • translit: “Netzach sheb’Tiferet”,
  • en: “Eternity within Beauty”

Giving appropriate credit to Hebcal

Most Hebcal content is licensed under a Creative Commons Attribution 4.0 International License (sometimes referred to as “CC BY 4.0”). If you use Hebcal.com content or APIs, continue reading to understand what privileges this license grants and how you can give appropriate credit to Hebcal.

cc_by_logo

The CC BY 4.0 license is designed to encourage use and reuse of content. You can remix, transform, and build upon the material for any purpose, even commercially. You need not ask for permission, notify us about the usage, or send us money. This license gives you permission to freely to copy and redistribute the material in any medium or format as long as you give appropriate credit to Hebcal.com.

Creative Commons licenses have a flexible attribution requirement, so there is not necessarily one correct way to provide attribution. The proper method for giving credit will depend on the medium and means you are using, and may be implemented in any reasonable manner.

On a website, you might include a short piece of text with a link back to Hebcal.com, e.g.:

Powered by Hebcal Shabbat Times

Or you might include the following at the bottom of a printed page or refrigerator magnet:

Jewish holidays and candle-lighting times are provided by Hebcal.com with a CC BY 4.0 International License.

Creative Commons publishes best practices for attribution which includes some good (and not so good) examples of attribution.