Skip to content

POST /geo/resolve

Finds the Lowest Common Ancestor (LCA) of a list of place names — the most specific geographic region that contains all of them.

Costs 1 credit per request.

POST /geo/resolve
Authorization: Bearer gaz_<api-key>
Content-Type: text/plain
X-Min-Score: 0.6 (optional)

Body: newline-separated list of place names (plain text).

Cuiabá
Sinop
Rondonópolis
HeaderTypeDefaultDescription
AuthorizationstringrequiredBearer gaz_<api-key>
X-Min-Scorefloat0.6Minimum similarity score (0.0–1.0) for a name to be considered resolved. Names below this threshold are skipped and counted in unresolved.
{
"region": "Mato Grosso",
"type": "state",
"region_id": 3457419,
"unresolved": 0,
"total": 3
}
FieldTypeDescription
regionstringName of the common ancestor region
typestringworld | country | state | city
region_idintegerPlace ID — use with GET /geo/place/{id}
unresolvedintegerNumber of input names that couldn’t be matched above X-Min-Score
totalintegerTotal number of input names sent
StatusDescription
401Missing or invalid API key
402Insufficient credits
404No common region found (all inputs resolved to places with no common ancestor, or all unresolved)
422Empty request body
429Rate limit exceeded
{
"detail": {
"message": "No common region found",
"unresolved": 1,
"total": 3
}
}
Terminal window
curl -X POST https://api.gazetteer.dev/geo/resolve \
-H "Authorization: Bearer gaz_..." \
-H "Content-Type: text/plain" \
--data "Paris
Lyon
Marseille"
{
"region": "France",
"type": "country",
"region_id": 3017382,
"unresolved": 0,
"total": 3
}

Raise X-Min-Score to reject ambiguous matches:

Terminal window
curl -X POST https://api.gazetteer.dev/geo/resolve \
-H "Authorization: Bearer gaz_..." \
-H "X-Min-Score: 0.8" \
-H "Content-Type: text/plain" \
--data "São Paulo
Campinas"

A non-zero unresolved count means some inputs were skipped. The LCA was computed only over the resolved subset. If confidence matters, check:

confidence = (total - unresolved) / total