Geo Data#

These andpoins helps the user to choose the city/timezone from the database instead of typing geo coordinates and search for timezone for a specific year. These endpoints are protected (see access levels). They are accessed by an authenticated user with any of the access levels.

  • /api/geo/cities/
  • /api/geo/timezone/

List of Cities#

/api/geo/cities/

Use this endpoint to get the list of cities, which start from the given letters. By default it returns the list in English. Use the lang parameter to return result in a local (client's) language.

Request#

Method GET

Value Required Comment
starts_with yes min 3 letters
lang no 2-letter language code

Response#

[
    {
        "lang_code": "ru",
        "name": "Нижний Новгород",
        "lon": 44.00205,
        "lat": 56.32867,
        "country": "Россия",
        "subdivision": null,
        "tz_code": "Europe/Moscow"
    },
    {
        "lang_code": "ru",
        "name": "Нижний Тагил",
        "lon": 59.965,
        "lat": 57.91944,
        "country": "Россия",
        "subdivision": null,
        "tz_code": "Asia/Yekaterinburg"
    }
    // ..etc. Maximum 10 elements in total
]

Time Zone#

/api/geo/timezone/

Use this endpoint to get the UTC offset in hours for any specified date and local mean time (wall clock time) for any time zone in IANA database format (like Europe/Moscow).

Request#

Method Post

Value Type Required Comment
tz_code str yes f.e. America/Los_Angeles
year int yes
month int yes 1..12
day int yes
hour int yes
minute int yes
second int no

Response#

{
    "utc_offset": 2.5219444444444443
}

All UTC offset shifts for a give timezone#

/api/geo/all-timezones/

Use this endpoint to get the moments of UTC offsets in hours for any time zone in IANA database format (like Europe/Moscow).

Request#

Method Post

Value Type Required Comment
tz_code str yes f.e. America/Los_Angeles

Response#

{
    "shifts": [
        {
            "shift_time": "Asia/Tbilisi  Wed Dec 31 21:00:48 1879 UT",
            "new_time": "Wed Dec 31 23:59:59 1879 LMT ",
            "isdst": false,
            "offset": "02:59:11"
        },
        ...
    ]
}