Geocoding
Overview
The Geocoding API lets you search for locations worldwide and retrieve location details. It supports fuzzy matching, localized results, and direct ID lookups.
Search
Search for locations by name with optional fuzzy matching.
GET /geocoding/lookup?q={query}Parameters
Parameter | Required | Default | Description |
|---|---|---|---|
| Yes | — | Search query (minimum 2 characters) |
| No |
| Language code for localized results (e.g. |
| No |
| Search scope. |
| No | — | ISO 3166-1 alpha-2 country code to filter results (e.g. |
| No |
| Maximum number of results (max 50) |
Example Request
GET /geocoding/lookup?q=Zurich&language=en&limit=5
Example Response
{
"results": [
{
"id": "3704415940",
"name": "Zürich",
"lat": 47.36667,
"lon": 8.55,
"country_code": "CH",
"country_name": "Switzerland",
"admin1_name": "Kanton Zürich",
"timezone": "Europe/Zurich",
"population": 341730,
"feature_code": "PPLA"
}
],
"count": 1
}Lookup by ID
Retrieve a specific location by its unique ID.
GET /geocoding/lookup?id={location_id}Parameters
Parameter | Required | Description |
|---|---|---|
| Yes | The location’s unique public ID |
Example Request
GET /geocoding/lookup?id=3704415940
Example Response
{
"id": "3704415940",
"name": "Zürich",
"lat": 47.36667,
"lon": 8.55,
"country_code": "CH",
"country_name": "Switzerland",
"admin1_name": "Kanton Zürich",
"admin2_name": "Bezirk Zürich",
"timezone": "Europe/Zurich",
"population": 341730,
"elevation": null,
"feature_code": "PPLA"
}Response Fields
Field | Type | Description |
|---|---|---|
| string | Unique location identifier |
| string | Location name (localized when |
| float | Latitude |
| float | Longitude |
| string | ISO 3166-1 alpha-2 country code |
| string | Country name |
| string | First-level administrative division (e.g. state, canton) |
| string | Second-level administrative division (e.g. district, county) |
| string | IANA timezone identifier |
| integer | Population (may be null) |
| integer | Elevation in meters (may be null) |
| string | Feature code indicating location type (e.g. |
List Countries
Retrieve a list of all countries.
GET /geocoding/countries
Results are sorted alphabetically by name. Returned in English only.
Example Response
{
"results": [
{
"code": "CH",
"name": "Switzerland",
"flag": "🇨🇭",
"population": 8700000,
"continent": "EU"
}
],
"count": 1
}Country Details
Retrieve details for a single country by its ISO 3166-1 alpha-2 code.
GET /geocoding/countries/{code}Parameters
Parameter | Required | Description |
|---|---|---|
| Yes | ISO 3166-1 alpha-2 country code (case-insensitive, e.g. |
Example Request
GET /geocoding/countries/CH
Example Response
{
"code": "CH",
"name": "Switzerland",
"flag": "🇨🇭",
"population": 8700000,
"continent": "EU",
"timezone": "Europe/Zurich",
"capital": "Bern"
}Country Response Fields
Field | Type | Description |
|---|---|---|
| string | ISO 3166-1 alpha-2 country code |
| string | Country name (English) |
| string | Flag emoji derived from the ISO code |
| integer | Country population (may be null) |
| string | Continent code (may be null) |
| string | Primary IANA timezone (detail endpoint only, may be null) |
| string | Capital city name (detail endpoint only, may be null) |
Errors
Status | Description |
|---|---|
| Missing required parameter ( |
| Location or country not found |
| Geocoding data not yet loaded |