Timezone API
Free public API for querying current times and time differences between cities and timezones. No API key required.
Base URL
https://timezones.live/api/v1Accepted Query Formats
Both endpoints accept flexible city/timezone identifiers:
City name
london, tokyoCity slug
new-york, sao-pauloIANA timezone
America/New_York, Asia/TokyoTimezone abbreviation
PST, JST, GMTUTC offset
utc+5, +9, utc-3:30Endpoints
GET
/api/v1/timeGet the current time for a single city or timezone.
Parameters
cityrequiredCity name, slug, IANA timezone (e.g. America/New_York), abbreviation, or UTC offsetExample Request
curl "https://timezones.live/api/v1/time?city=london"Example Response
{
"ok": true,
"data": {
"city": "London",
"country": "UK",
"flag": "🇬🇧",
"timezone": "Europe/London",
"utcOffset": "UTC+0",
"currentTime": "02:30 PM",
"currentDate": "Fri Mar 7",
"coordinates": {
"lat": 51.5074,
"lng": -0.1278
}
}
}GET
/api/v1/compareCompare the current time between two cities or timezones.
Parameters
fromrequiredSource city name, slug, IANA timezone, abbreviation, or UTC offsettorequiredTarget city name, slug, IANA timezone, abbreviation, or UTC offsetExample Request
curl "https://timezones.live/api/v1/compare?from=london&to=tokyo"Example Response
{
"ok": true,
"data": {
"from": {
"city": "London",
"country": "UK",
"flag": "🇬🇧",
"timezone": "Europe/London",
"utcOffset": "UTC+0",
"currentTime": "02:30 PM",
"currentDate": "Fri Mar 7",
"coordinates": {
"lat": 51.5074,
"lng": -0.1278
}
},
"to": {
"city": "Tokyo",
"country": "Japan",
"flag": "🇯🇵",
"timezone": "Asia/Tokyo",
"utcOffset": "UTC+9",
"currentTime": "11:30 PM",
"currentDate": "Fri Mar 7",
"coordinates": {
"lat": 35.6762,
"lng": 139.6503
}
},
"difference": {
"hours": 9,
"description": "9 hours",
"direction": "Tokyo is 9 hours ahead of London"
}
}
}Browser Usage
You can pass the browser's IANA timezone directly — no need to convert to UTC offsets.
// Get the user's IANA timezone from the browser
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
// e.g. "America/New_York"
// Pass it directly to the API
const res = await fetch(`https://timezones.live/api/v1/time?city=${tz}`);
const { data } = await res.json();
// { city: "New York", timezone: "America/New_York", currentTime: "02:30 PM", ... }
// Compare the user's timezone with another city
const cmp = await fetch(
`https://timezones.live/api/v1/compare?from=${tz}&to=Asia/Tokyo`
);Error Responses
All errors return a consistent JSON format:
{
"ok": false,
"error": "Error description"
}| Status | Meaning |
|---|---|
400 | Missing required parameters |
404 | City or timezone not found |
429 | Rate limit exceeded (includes Retry-After header) |
500 | Internal server error |
Rate Limiting
Limit:100 requests per minute per IP address
Header:
Retry-After— seconds until the rate limit resets (included on 429 responses)Part of Timezones.live