The Timezone API provides timezone and time offset data for any latitude/longitude coordinates or city in the world.
https://api.api-ninjas.com/v1/timezone
Get timezone info by city/state/country or location coordinates (latitude/longitude). Returns the timezone name of the specified input location and the time offset in seconds.
timezone requiredTimezone name.
lat required premiumLatitude of desired location.
lon required premiumLongitude of desired location.
city required premiumCity name.
state optional premiumUS state (for United States cities only).
country optional premiumCountry name.
X-Api-Key requiredAPI Key associated with your account.
The response will be a JSON object with the following fields:
timezoneTimezone name.
utc_offsetTime offset in seconds from GMT.
local_timeLocal time in the specified timezone.
cityCity name. Only available for lat/lon or city/state/country inputs.
https://api.api-ninjas.com/v1/timezone?timezone=Europe/LondonHeaders
X-Api-KeyLog in or sign up to get your API Key1
2
3
4
5
6
{
"timezone": "Europe/London",
"utc_offset": 0,
"local_time": "2025-03-05 05:50:32",
"city": "london"
}1
2
curl -X GET "https://api.api-ninjas.com/v1/timezone?city=London" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.