POST
locci/geo/city/nearby/
Up to five cities nearest to a given city, excluding the city itself.
Locci
Geography
Overview
Returns up to five cities geographically closest to a given reference city, excluding the reference city itself. The search is limited to smaller or less-prominent places (cities without a top-tier ranking) so the results represent genuine local neighbours rather than major regional hubs. Each result includes the city name, coordinates, and distance in kilometres from the reference city. Useful for building 'nearby places' features or providing geographic context around a selected city.
Request parameters
| Name |
Type |
In |
Required |
Description |
Example |
city_slug |
String |
Body |
Yes
|
Slug of a city record. Obtain valid city slugs from the city list, nearest, or search endpoints. |
|
is_coastal |
Boolean |
Body |
Optional
|
|
|
Response fields
| Name |
Type |
Nullable |
Description |
Example |
results |
Array |
—
|
Array of up to five cities near the reference city, excluding the reference city itself. |
|
results[].admin1 |
String |
—
|
Region/state/province code (admin level 1). |
BC |
results[].admin1_id |
Integer |
—
|
Primary key of the region record. |
75 |
results[].city_id |
Integer |
—
|
Alias for the city primary key, provided for consistency with other endpoints. |
5969782 |
results[].continent_id |
Integer |
—
|
Primary key of the continent record. |
2 |
results[].country_id |
Integer |
—
|
Primary key of the country record. |
38 |
results[].country_iso |
String |
—
|
ISO 3166-1 alpha-2 code of the country. |
CA |
results[].country_name |
String |
—
|
Full name of the country. |
Canada |
results[].distance |
Float |
—
|
Distance from the query point to this city in kilometres, rounded to one decimal place. |
3.7 |
results[].id |
Integer |
—
|
Primary key of the city. |
5969782 |
results[].lat |
String |
Yes
|
Latitude of the city in decimal degrees. |
48.4284 |
results[].lon |
String |
Yes
|
Longitude of the city in decimal degrees. |
-123.3648 |
results[].name |
String |
—
|
Name of the city. |
Victoria |
results[].slug |
String |
—
|
URL-friendly city name. |
victoria |