Timezone API Documentation
Start with a free developer token.
Usage
Timezone requests are sent to any of the following endpoints:
-
Region 1: US East (Northern Virginia)
https://us1.unwiredlabs.com/v2/timezone.php
-
Region 2: US West (San Francisco)
https://us2.unwiredlabs.com/v2/timezone.php
-
https://eu1.unwiredlabs.com/v2/timezone.php
-
Region 4: Asia Pacific (Singapore)
https://ap1.unwiredlabs.com/v2/timezone.php
Request body
Send the following data as a POST request as JSON.- token - Your API token. If you don't have one, get one free here!
- lat - The latitude for generating the timezone
- lon - The longitude to generating the timezone
{ "token": "Your_API_Token", "lat": 17.43, "lon": 78.57 }
Response body
The response will be a JSON object.
-
Header:
200 OK
-
Parameters
- status: If the request is successful,
ok
is returned. - timezone
- name : Name of the IANA Time zone
-
now_in_dst :
0
or1
0
represents the zone is currently not observing DST.1
represents the zone is currently observing DST. - offset_sec : The offset from UTC (in seconds) for the given location. Considers DST savings.
- short_name : Abbreviation of the Timezone (List of Timezone Abbreviations)
- status: If the request is successful,
{ "timezone": { "name": "Asia/Kolkata", "now_in_dst": 0, "offset_sec": 19800, "short_name": "IST" }, "status": "ok" }
Errors
- No key provided
- Header :
400 Bad Request
- Parameters
- status :
error
- message :
NO_KEY
- status :
- Header :
- Invalid / Inactive Keys
- Header :
401 Unauthorized
- Parameters
- status :
error
- message :
INVALID_KEY
- status :
- Header :
- No Input (latitude / longitude)
- Header :
400 Bad Request
- Parameters
- status :
error
- message :
INVALID_INPUT
- status :
- Header :
- No results
- Header :
200 OK
- Parameters
- status :
error
- message :
NO_RESULTS
- status :
- Header :
- Daily limit
- Header :
429 Too Many Requests
- Parameters
- status :
error
- message :
DAILY_LIMIT
- status :
- Header :
- Unknown errors at Server-side
- Header :
500 Internal Server Error
/503 Service Unavailable
- Parameters
- status :
error
- message :
UNKNOWN_ERROR
- status :
- Header :
{ "status": "error", "message": "INVALID_TOKEN" }
Notes
- There are a few timezones that are listed as disputed in the "Notes" section of Wikipedia.