Geo Data

Countries

GET /v1/resources/countries

Returns list of countries.

Request Headers:
 
Response Headers:
 
Query Parameters:
 
  • ids (string) – List of object ids to return
  • limit (number) – Limit returned collection by specified number
  • offset (number) – Skip specified number of object from start
  • suggest (string) – Asks to suggest the countries which contains specified substring
  • fields-schema (string) – Fields Schema DSL
Response JSON Array of Objects:
 
  • id (string) – Country ID
  • name (object) – Mapping of locale to localized name
  • type (string) – Object type
Status Codes:

Request:

GET /v1/resources/countries?limit=4 HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "id": "AF",
        "name": {
            "default": "Afghanistan",
            "en": "Afghanistan"
        },
        "type": "country"
    },
    {
        "id": "AX",
        "name": {
            "default": "Aland Islands",
            "en": "Aland Islands"
        },
        "type": "country"
    },
    {
        "id": "AL",
        "name": {
            "default": "Albania",
            "en": "Albania"
        },
        "type": "country"
    },
    {
        "id": "DZ",
        "name": {
            "default": "Algeria",
            "en": "Algeria"
        },
        "type": "country"
    }
]

When you don’t really know which country you’re looking for, you can pass suggest query parameter to filter alike countries by the specified name:

Request:

GET /v1/resources/countries?suggest=Rus HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "id": "RU",
        "name": {
            "default": "Russia",
            "en": "Russia"
        },
        "type": "country"
    }
]

Cities

GET /v1/resources/cities

Returns list of cities.

Request Headers:
 
Response Headers:
 
Query Parameters:
 
  • ids (string) – List of object ids to return
  • limit (number) – Limit returned collection by specified number
  • offset (number) – Skip specified number of object from start
  • suggest (string) – Asks to suggest the countries which contains specified substring
  • sort (str) – sort by field in django-style (“population” or “-populanion”)
  • fields-schema (string) – Fields Schema DSL
Response JSON Array of Objects:
 
  • country (string) – Country ID
  • id (object) – City ID
  • name (object) – Mapping of locale to localized name
  • timezone (string) – Timezone in Olson database format
  • type (string) – Object type
  • populanion (int) – populanion
Status Codes:

Request:

GET /v1/resources/cities?country=ru&sort=-population&limit=2 HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: application/json; charset=UTF-8
Server: nginx
Transfer-Encoding: chunked

[
    {
        "name": {
            "be": "\u0413\u043e\u0440\u0430\u0434 \u041c\u0430\u0441\u043a\u0432\u0430",
            "fr": "Moscou",
            "ru": "\u041c\u043e\u0441\u043a\u0432\u0430",
            "default": "Moscow",
            "en": "Moscow",
            "zh": "\u83ab\u65af\u79d1"
        },
        "country": "RU",
        "type": "city",
        "population": 10381222,
        "id": 524901,
        "timezone": "Europe/Moscow"
    },
    {
        "name": {
            "default": "Saint Petersburg",
            "en": "Saint-Petersburg",
            "fr": "Saint-P\u00e9tersbourg",
            "ru": "\u0421\u0430\u043d\u043a\u0442-\u041f\u0435\u0442\u0435\u0440\u0431\u0443\u0440\u0433"
        },
        "country": "RU",
        "type": "city",
        "population": 5028000,
        "id": 498817,
        "timezone": "Europe/Moscow"
    }
]

Оглавление

Предыдущий раздел

Events

Следующий раздел

Media Files

Эта страница