Timezone API Documentation

Start with a free developer token.

Timezone API Documentation

Usage

Timezone requests are sent to any of the following endpoints:

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
Here's a sample request in JSON format:
{
    "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 or 1
        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)
Here's a successful output in JSON format:
{
    "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
  • Invalid / Inactive Keys
    • Header : 401 Unauthorized
    • Parameters
      • status : error
      • message : INVALID_KEY
  • No Input (latitude / longitude)
    • Header : 400 Bad Request
    • Parameters
      • status : error
      • message : INVALID_INPUT
  • No results
    • Header : 200 OK
    • Parameters
      • status : error
      • message : NO_RESULTS
  • Daily limit
    • Header : 429 Too Many Requests
    • Parameters
      • status : error
      • message : DAILY_LIMIT
  • Unknown errors at Server-side
    • Header : 500 Internal Server Error / 503 Service Unavailable
    • Parameters
      • status : error
      • message : UNKNOWN_ERROR
Here's an unsuccessful output in JSON format:
{
    "status": "error",
    "message": "INVALID_TOKEN"
}

Notes