Sunsetting APIs

Timezone

Look up time offset data for any location on the surface of the earth, including DST handling.

The Unwired Labs TimeZone API provides time offset data for locations on the surface of the earth.

This API will be deprecated on 1st April 2027. Please migrate to the LocationIQ Timezone API - also an Unwired Labs product, and a more robust offering.

Usage

GET requests can be sent to the following URL:

https://us1.unwiredlabs.com/v2/timezone?token=YOUR_API_TOKEN&lat=LATITUDE&lon=LONGITUDE

Replace us1 with a region that's closer to your location.

curl --request GET \
  --url 'https://us1.unwiredlabs.com/v2/timezone?token=YOUR_API_TOKEN&lat=LATITUDE&lon=LONGITUDE'

Query Parameters

NameDescriptionRequired
tokenAuthentication tokenYes
latLatitude of the locationYes
lonLongitude of the locationYes

Response

The above command returns JSON structured like this:

{
  "status": "ok",
  "balance": 5000,
  "timezone": {
    "name": "Asia/Kolkata",
    "now_in_dst": 0,
    "offset_sec": 19800,
    "short_name": "IST"
  }
}
NameDescription
statusok on success; error on error
balanceBalance left in the account
timezoneTimezone object found for the location. Read more

Timezone Response

NameDescription
short_nameShort name of the Timezone
offset_secThe offset from UTC (in seconds) for the given location. Considers DST savings.
now_in_dstRepresents whether the zone currently observing DST or not
nameTimezone name of the Location

Errors

Unlike our other APIs, this endpoint can respond with a non-200 HTTP status code, noted per error below - always check the status field in the response body in addition to the HTTP status code.

{
  "status": "error",
  "message": "Error message"
}

When certain types of errors are encountered, the API responds with the following error messages:

Error MessageHTTP StatusDescription
INVALID_TOKEN200The user's token set is not valid
INACTIVE_TOKEN200The user's token is not active
ACCESS_RESTRICTED403The access token does not have the geocoding:timezone scope required by this endpoint.
INVALID_INPUT400The request does not contain the required input in the specified format
NO_RESULTS200The request is valid and we could not find a timezone for the given coordinates
DAILY_LIMIT429The daily quota for timezone lookups has been reached
UNKNOWN_ERROR500 or 503Due to a server error, we are unable to serve your request. You can retry this request.

On this page