Skip to content

GET /geo/search

Performs a fuzzy search across all place names and returns the best matches ranked by similarity and population.

Useful for autocomplete, debugging resolution issues, or exploring the place database.

Costs 1 credit per request.

GET /geo/search?q={term}&limit={n}
Authorization: Bearer gaz_<api-key>
ParameterTypeDefaultDescription
qstringrequiredSearch term
limitinteger5Maximum number of results to return
[
{
"id": 3448439,
"name": "São Paulo",
"type": "city",
"score": 0.909,
"population": 12252023
},
{
"id": 3448433,
"name": "São Paulo",
"type": "state",
"score": 0.909,
"population": 44396484
}
]
FieldTypeDescription
idintegerPlace ID
namestringOfficial place name
typestringworld | country | state | city
scorefloatSimilarity score (0.0–1.0)
populationintegerPopulation count

Results are sorted by score DESC, population DESC.

StatusDescription
401Missing or invalid API key
402Insufficient credits
429Rate limit exceeded
Terminal window
curl "https://api.gazetteer.dev/geo/search?q=cuiab%C3%A1&limit=3" \
-H "Authorization: Bearer gaz_..."
[
{ "id": 3952981, "name": "Cuiabá", "type": "city", "score": 1.0, "population": 615297 }
]

The search tolerates minor typos and missing accents:

Terminal window
curl "https://api.gazetteer.dev/geo/search?q=sao+paulo" \
-H "Authorization: Bearer gaz_..."

Results with score below PostgreSQL’s pg_trgm threshold (~0.3) are automatically excluded.