← Back to docs
endpoints
GET locci/geo/city/autocomplete/

City names starting with the posted query string.

Locci Geography

Overview

Returns a lightweight list of cities matching a name prefix, optimised for use in autocomplete or typeahead UI components. Each result contains only the city name, slug, country name, and region name — the minimal set needed to render a suggestion list without large payloads. Query using a search parameter. For full city details including coordinates and timezone, follow up with the city detail endpoint using the returned slug or pk.


Request parameters

Name Type In Required Description Example
q String Query Optional Name prefix to search for. The city list is filtered to cities whose name starts with this value. Case-insensitive. Typically one or more characters typed by the user in a search box. van

Response fields

Name Type Nullable Description Example
country_name String Name of the parent country. Canada
name String Official city name. Victoria
pk Integer Database primary key of the city record. 42
region_name String Name of the parent administrative region. British Columbia
slug String Yes URL-friendly city name. victoria