The API
An autonomous Jewish timestamp, in JSON or text. Free, no key, no Gregorian.
Principles
- Base:
/api/. Responses in JSON; sendAccept: text/plainor add?format=textfor text. - No key, no registration. Open CORS (
Access-Control-Allow-Origin: *). - Rate limit per address: 20 requests per unit of cadence, burst of 60; beyond that,
429withRetry-After. Cache-Control: max-age=1on/api/now; one day on purely arithmetic responses.- Code under the MIT licence. API responses under CC BY 4.0: free reuse with attribution “zman, zman.technology”.
Units and constants
| Name | Value | Note |
|---|---|---|
| rega’im per chelek | 76 | Rambam, Hilkhot Kiddush ha-Chodesh 10:1 |
| chalakim per hour | 1,080 | ibid. 6:2 |
| hours per day | 24 | from 18:00 Jerusalem mean time |
| rega’im per hour | 82,080 | |
| chalakim per day | 25,920 | |
| rega’im per day | 1,969,920 | always, whatever the length of the day |
| epoch | rega 0 | Saturday 18:00 opening the week of the molad Tohu; day 0 = Sunday |
| molad Tohu | 2,395,824 | day 1, 5 h, 204 ch |
| 1 Tishrei of year 1 | day 1 | Monday |
| months | 1 – 13 | Nisan = 1 … Adar = 12 (Adar I in a leap year), Adar II = 13 |
| weekday | 0 – 6 | Sunday = 0, Shabbat = 6 |
Endpoints
GET /api/now
The present instant: rega, day, hour, chelek, rega within the chelek, date, weekday, and clock quality (source: iers or fallback; dut1_age_days: age of the last measurement; predicted: the DUT1 value is a prediction).
curl -s https://zman.technology/api/now
{
"rega": 4163021922875,
"day": 2113294,
"hour": 22,
"chelek": 8,
"rega_in_chelek": 27,
"date": {
"year": 5786,
"month": 6,
"month_name": "Elul",
"month_name_he": "אלול",
"day": 25
},
"weekday": 1,
"weekday_name_he": "יום שני",
"clock": {
"source": "iers",
"dut1_age_days": 4.6,
"predicted": true
}
}
As text:
curl -s -H 'Accept: text/plain' https://zman.technology/api/now
rega 4163021922875
day 2113294 hour 22 chelek 8 rega 27
date 25 Elul 5786 (אלול)
weekday 1 יום שני
clock source=iers dut1_age_days=4.6 predicted=true
GET /api/rega/{n}
Decodes an integer into day, hour, chelek, rega, date and weekday. For a day before 1 Tishrei of year 1, date is null. Example: the molad Tohu.
curl -s https://zman.technology/api/rega/2395824
{
"rega": 2395824,
"day": 1,
"hour": 5,
"chelek": 204,
"rega_in_chelek": 0,
"date": {
"year": 1,
"month": 7,
"month_name": "Tishrei",
"month_name_he": "תשרי",
"day": 1
},
"weekday": 1,
"weekday_name_he": "יום שני"
}
GET /api/date/{year}/{month}/{day}
The given day, with its first rega (start) and the first rega of the next day (end, exclusive). Error 400 if the date does not exist (30 Cheshvan in a deficient year, Adar II in a common year, and so on).
curl -s https://zman.technology/api/date/5787/7/1
{
"date": {
"year": 5787,
"month": 7,
"month_name": "Tishrei",
"month_name_he": "תשרי",
"day": 1
},
"day": 2113299,
"weekday": 6,
"weekday_name_he": "שבת",
"start": 4163029966080,
"end": 4163031936000
}
GET /api/molad/{year}/{month}
The mean molad of the month, in rega and in parts. The convention is that of the announcements: hours counted from 18:00 the previous evening. “Friday night 8:59 pm and 1 chelek” therefore appears as weekday 6 (the halachic day has begun), 2 hours, 1,063 chalakim.
curl -s https://zman.technology/api/molad/5787/7
{
"rega": 4163030211028,
"day": 2113299,
"hour": 2,
"chelek": 1063,
"rega_in_chelek": 0,
"date": {
"year": 5787,
"month": 7,
"month_name": "Tishrei",
"month_name_he": "תשרי",
"day": 1
},
"weekday": 6,
"weekday_name_he": "שבת"
}
GET /api/year/{year}
Length of the year, leap status, Rosh Hashanah, and the months in civil order with their length and first day.
curl -s https://zman.technology/api/year/5787
{
"year": 5787,
"length": 385,
"leap": true,
"rosh_hashana": {
"day": 2113299,
"weekday": 6,
"weekday_name_he": "שבת"
},
"months": [
{
"month": 7,
"name": "Tishrei",
"name_he": "תשרי",
"length": 30,
"start_day": 2113299
},
{
"month": 8,
"name": "Cheshvan",
"name_he": "חשון",
"length": 30,
"start_day": 2113329
},
{
"month": 9,
"name": "Kislev",
"name_he": "כסלו",
"length": 30,
"start_day": 2113359
},
{
"month": 10,
"name": "Tevet",
"name_he": "טבת",
"length": 29,
"start_day": 2113389
},
{
"month": 11,
"name": "Shevat",
"name_he": "שבט",
"length": 30,
"start_day": 2113418
},
{
"month": 12,
"name": "Adar I",
"name_he": "אדר א׳",
"length": 30,
"start_day": 2113448
},
{
"month": 13,
"name": "Adar II",
"name_he": "אדר ב׳",
"length": 29,
"start_day": 2113478
},
{
"month": 1,
"name": "Nissan",
"name_he": "ניסן",
"length": 30,
"start_day": 2113507
},
{
"month": 2,
"name": "Iyar",
"name_he": "אייר",
"length": 29,
"start_day": 2113537
},
{
"month": 3,
"name": "Sivan",
"name_he": "סיון",
"length": 30,
"start_day": 2113566
},
{
"month": 4,
"name": "Tammuz",
"name_he": "תמוז",
"length": 29,
"start_day": 2113596
},
{
"month": 5,
"name": "Av",
"name_he": "אב",
"length": 30,
"start_day": 2113625
},
{
"month": 6,
"name": "Elul",
"name_he": "אלול",
"length": 29,
"start_day": 2113655
}
]
}
GET /api/health
State of the clock and of the IERS cache. 200 when all is well, 503 in degraded mode (no IERS data).
curl -s https://zman.technology/api/health
{
"status": "ok",
"clock": {
"source": "iers",
"dut1_age_days": 4.6,
"predicted": true
},
"data": {
"loaded": true,
"records": 19976,
"measured_records": 19603,
"source": "disk",
"cache_age_days": 0
}
}
What the API will never return
No response contains a Gregorian date, a Unix timestamp, a UTC time or a duration in seconds. This is not an omission: it is the point of the project. The counter is native — the epoch is Jewish, the unit is the rega, the clock is the Earth’s rotation — and translating it into the time of the nations would make it a derivative of exactly what it means to be free of. The SI second and the Gregorian calendar exist only in the package that reads the machine clock; an automated test walks every response and forbids the fields and words unix, utc, iso, gregorian, seconds. If you need a conversion, hebcal does it very well; we will not do it here.
The old unprefixed paths (/now, /rega/…) answer with a 301 redirect to /api/….