get_geo_locations#
Query | Public
Geocoding lookup — converts a free-text address into coordinate results. Accepts optional sort_country_code to prioritize results for a given country. No authentication required. Returns up to 10 ranked results with street, city, state, country, postal code, and decimal coordinates.
from dlubal.api import geo_zone_tool
geo_zone = geo_zone_tool.GeoZoneTool()
locations = geo_zone.get_geo_locations(
address="Altdorf, Uri, Switzerland",
sort_country_code="CH",
language=geo_zone_tool.Language.EN,
)
for loc in locations.locations:
print(loc.display_name)
using GeoZoneTool;
using GeoZoneTool.Models;
using var client = new GeoZone("your-token");
var locations = await client.GetGeoLocationsAsync(
new GetGeoLocationsRequest
{
Address = "Altdorf, Uri, Switzerland",
SortCountryCode = "CH",
Language = LanguageEnum.En
});
foreach (var location in locations?.Locations ?? [])
{
Console.WriteLine(location.DisplayName);
}
query {
getGeoLocations(
address: "Altdorf, Uri, Switzerland"
sortCountryCode: "CH"
language: EN
) {
latitude longitude altitude
displayName street zip city state country countryCode
}
}
Input#
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
str |
Yes |
Free-text address or place name |
|
str |
No |
ISO country code — results prioritized for this country |
|
Language |
No |
Response language (default EN) |
Response#
Returns GeoLocations containing a list of GeoLocation objects.