v1

latestSwagger 2.0Creative Commons Attribution 3.02026-07-14263452.9 KB
Geo

Find divisions near location

Find administrative divisions near the given location, filtering by optional criteria. If no criteria are set, you will get back all known divisions.

get/geo/locations/{locationId}/nearbyDivisions

Path parameters

locationIdstring required

A latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD

Query parameters

radiusinteger

The location radius within which to find places

distanceUnitstring

The unit of distance: MI | KM

countryIdsstring

Only places in these countries (comma-delimited country codes or WikiData ids)

excludedCountryIdsstring

Only places NOT in these countries (comma-delimited country codes or WikiData ids)

minPopulationinteger

Only places having at least this population

maxPopulationinteger

Only places having no more than this population

namePrefixstring

Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language.

namePrefixDefaultLangResultsboolean

When name-prefix matching, whether or not to match on names in the default language if a non-default languageCode is set.

timeZoneIdsstring

Only places in these time-zones (comma-delimited)

asciiModeboolean

Display results using ASCII characters

hateoasModeboolean

Include HATEOAS-style links in results

languageCodestring

Display results in this language

limitinteger

The maximum number of results to retrieve

offsetinteger

The zero-ary offset index into the results

sortstring

How to sort places. Format: ±SORT_FIELD,±SORT_FIELD where SORT_FIELD = countryCode | elevation | name | population

includeDeletedstring

Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE

Response

A list of populated places

Example response

{
  "data": [
    {
      "country": "Andorra",
      "countryCode": "AD",
      "id": 2987553,
      "latitude": 42.57777778,
      "longitude": 1.61944444,
      "name": "L'Aldosa de Canillo",
      "region": "Canillo",
      "regionCode": 2,
      "type": "CITY",
      "wikiDataId": "Q24371"
    },
    {
      "country": "Andorra",
      "countryCode": "AD",
      "id": 3086756,
      "latitude": 42.57667,
      "longitude": 1.51773,
      "name": "La Cortinada",
      "region": "Ordino",
      "regionCode": 5,
      "type": "CITY",
      "wikiDataId": "Q24486"
    },
    {
      "country": "Andorra",
      "countryCode": "AD",
      "id": 3056764,
      "latitude": 42.4859,
      "longitude": 1.49045,
      "name": "La Margineda",
      "region": "Andorra la Vella",
      "regionCode": 7,
      "type": "CITY",
      "wikiDataId": "Q2536296"
    },
    {
      "country": "Andorra",
      "countryCode": "AD",
      "id": 978,
      "latitude": 42.544354,
      "longitude": 1.515427,
      "name": "La Massana",
      "region": "La Massana",
      "regionCode": 4,
      "type": "CITY",
      "wikiDataId": "Q3820973"
    },
    {
      "country": "Andorra",
      "countryCode": "AD",
      "id": 759,
      "latitude": 42.5,
      "longitude": 1.53333333,
      "name": "Les Escaldes",
      "region": "Escaldes-Engordany",
      "regionCode": "08",
      "type": "CITY",
      "wikiDataId": "Q1050185"
    }
  ],
  "links": [
    {
      "href": "/data/world/v1/geo/cities?offset=0&limit=5",
      "rel": "first"
    },
    {
      "href": "/data/world/v1/geo/cities?offset=0&limit=5",
      "rel": "prev"
    },
    {
      "href": "/data/world/v1/geo/cities?offset=10&limit=5",
      "rel": "next"
    },
    {
      "href": "/data/world/v1/geo/cities?offset=273685&limit=5",
      "rel": "last"
    }
  ],
  "metadata": {
    "currentOffset": 5,
    "totalCount": 273690
  }
}