This is a public JSON API for leap seconds announced by the IERS in Bulletin C. The API is available at https://leap.webclock.io/leap.json.
The master branch of this repository contains a daemon that periodically checks for updates to Bulletin C and notifies me via Gotify when a change is detected. Updates to the API may take up to 24 hours after a new bulletin is released. In rare cases, it may take longer due to personal circumstances. However, the API will remain available as long as Cloudflare's servers are operational, and updates will continue to be made as long as I do not get hit by a bus.
This API is planned for use in an ongoing project at webclock.io.
The API returns an array of objects representing individual leap seconds, ordered from most recent to least recent. Each object contains the following fields:
utc_date
: The UTC date, in ISO 8601 format, at which the leap second is applied. Note that leap seconds are applied at 00:00:00 UTC on the specified date.utc_to_tai_offset
: The International Atomic Time (TAI) offset in seconds, which can be used to convert between UTC and TAI (invert the value for the reverse conversion).
[
{
"utc_date": "2017-01-01",
"utc_to_tai_offset": -37
},
{
"utc_date": "2015-07-01",
"utc_to_tai_offset": -36
},
{
"utc_date": "2012-07-01",
"utc_to_tai_offset": -35
}
]