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/v1

Accepted Query Formats

Both endpoints accept flexible city/timezone identifiers:

City namelondon, tokyo
City slugnew-york, sao-paulo
IANA timezoneAmerica/New_York, Asia/Tokyo
Timezone abbreviationPST, JST, GMT
UTC offsetutc+5, +9, utc-3:30

Endpoints

GET/api/v1/time

Get the current time for a single city or timezone.

Parameters

cityrequiredCity name, slug, IANA timezone (e.g. America/New_York), abbreviation, or UTC offset

Example 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/compare

Compare the current time between two cities or timezones.

Parameters

fromrequiredSource city name, slug, IANA timezone, abbreviation, or UTC offset
torequiredTarget city name, slug, IANA timezone, abbreviation, or UTC offset

Example 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"
}
StatusMeaning
400Missing required parameters
404City or timezone not found
429Rate limit exceeded (includes Retry-After header)
500Internal 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)