← Back to docs
endpoints
POST locci/geo/city/search/

Cities whose slugified name starts with the given query string.

Locci Geography

Overview

Searches for cities whose name starts with the given query string and returns up to eight matches. The query is slugified before matching so accented characters and capitalisation differences are handled consistently — searching for 'sao' will match 'São Paulo'. Returns full city records including coordinates, country, region, and continent identifiers. For a lighter response intended for typeahead UI components, use the autocomplete endpoint instead.


Request parameters

Name Type In Required Description Example
name String Body Yes Partial city name to search for. The value is slugified before matching, so accented characters and capitalisation differences are handled automatically. Maximum 50 characters.

Response fields

Name Type Nullable Description Example
results Array Array of up to eight cities whose name matches the search query.
results[].admin1 String Region/state/province code (admin level 1). BC
results[].admin1_id Integer Primary key of the region record. 75
results[].admin1_name String Full name of the region/state/province. British Columbia
results[].city_id Integer Alias for the city primary key. 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 country code. CA
results[].country_name String Full name of the country. Canada
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