Skip to content
GuidesBlogPlaygroundDashboard

Geocode

Forward geocode an address
client.Geocode.Forward(ctx, query) (*GeocodeResult, error)
GET/api/v1/geocode
Forward geocode an address
client.Geocode.ForwardPost(ctx, body) (*GeocodeResult, error)
POST/api/v1/geocode
Reverse geocode a coordinate
client.Geocode.Reverse(ctx, query) (*ReverseGeocodeResult, error)
GET/api/v1/geocode/reverse
Reverse geocode a coordinate
client.Geocode.ReversePost(ctx, body) (*ReverseGeocodeResult, error)
POST/api/v1/geocode/reverse
Autocomplete a partial address
client.Geocode.Autocomplete(ctx, query) (*AutocompleteResult, error)
GET/api/v1/geocode/autocomplete
Autocomplete a partial address
client.Geocode.AutocompletePost(ctx, body) (*AutocompleteResult, error)
POST/api/v1/geocode/autocomplete
Batch geocode multiple addresses
client.Geocode.Batch(ctx, body) (*GeocodeBatchResponse, error)
POST/api/v1/geocode/batch
ModelsExpand Collapse
type AutocompleteResult struct{…}

GeoJSON FeatureCollection of autocomplete suggestions for partial address input. Optimized for low-latency type-ahead UIs. Content-Type: application/geo+json.

Features []GeocodingFeature

Autocomplete suggestions ordered by relevance

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

Coordinates GeoJsonGeometryCoordinatesUnion

Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc.

One of the following:
type GeoJsonGeometryCoordinatesPoint []float64

[longitude, latitude] or [longitude, latitude, elevation]

type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64

Array of [lng, lat] positions

type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64

Array of linear rings / line strings

type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64

Array of polygons

Type GeoJsonGeometryType

Geometry type

One of the following:
const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"
const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"
const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"
const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"
const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"
const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"
Properties GeocodingFeatureProperties

Geocoding result properties

DisplayName string

Formatted address or place name

Category stringoptional

POI category (e.g. restaurant, cafe, park). Present for place results.

City stringoptional

City or town name. Present for address results.

Confidence float64optional

Interpolation confidence (0-1). Present only for interpolated results.

maximum1
minimum0
Country stringoptional

Country name. Present for reverse geocode address results.

CountryCode stringoptional

ISO 3166-1 alpha-2 country code

maxLength2
minLength2
DistanceM float64optional

Distance from the query point in meters (reverse geocode / nearby only)

FullAddress stringoptional

Complete formatted address from the database. Present for reverse geocode address results.

HouseNumber stringoptional

House or building number. Present for address and interpolated results.

Interpolated booloptional

Whether this result was estimated by address interpolation rather than an exact database match.

Name stringoptional

Place name (raw). Present for reverse geocode place results.

OsmID int64optional

OpenStreetMap element ID (null for interpolated results)

OsmType GeocodingFeaturePropertiesOsmTypeoptional

OSM element type (node, way, relation)

One of the following:
const GeocodingFeaturePropertiesOsmTypeNode GeocodingFeaturePropertiesOsmType = "node"
const GeocodingFeaturePropertiesOsmTypeWay GeocodingFeaturePropertiesOsmType = "way"
const GeocodingFeaturePropertiesOsmTypeRelation GeocodingFeaturePropertiesOsmType = "relation"
Postcode stringoptional

Postal code. Present for reverse geocode address results.

Score float64optional

Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1.

minimum0
Source GeocodingFeaturePropertiesSourceoptional

Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses)

One of the following:
const GeocodingFeaturePropertiesSourceStructured GeocodingFeaturePropertiesSource = "structured"
const GeocodingFeaturePropertiesSourceBm25 GeocodingFeaturePropertiesSource = "bm25"
const GeocodingFeaturePropertiesSourceFuzzy GeocodingFeaturePropertiesSource = "fuzzy"
const GeocodingFeaturePropertiesSourceAddress GeocodingFeaturePropertiesSource = "address"
const GeocodingFeaturePropertiesSourcePlace GeocodingFeaturePropertiesSource = "place"
const GeocodingFeaturePropertiesSourceInterpolation GeocodingFeaturePropertiesSource = "interpolation"
State stringoptional

State or province name. Present for reverse geocode address results.

Street stringoptional

Street name. Present for address and interpolated results.

Subcategory stringoptional

POI subcategory. Present for place results.

Tags map[string, string]optional

Raw OSM tags. Present for place results.

Wikipedia stringoptional

Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places.

Type GeocodingFeatureType
Type AutocompleteResultType
type GeocodeResult struct{…}

GeoJSON FeatureCollection of forward geocoding results, ordered by relevance. Content-Type: application/geo+json.

Features []GeocodingFeature

Geocoding results ordered by relevance score

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

Coordinates GeoJsonGeometryCoordinatesUnion

Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc.

One of the following:
type GeoJsonGeometryCoordinatesPoint []float64

[longitude, latitude] or [longitude, latitude, elevation]

type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64

Array of [lng, lat] positions

type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64

Array of linear rings / line strings

type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64

Array of polygons

Type GeoJsonGeometryType

Geometry type

One of the following:
const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"
const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"
const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"
const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"
const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"
const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"
Properties GeocodingFeatureProperties

Geocoding result properties

DisplayName string

Formatted address or place name

Category stringoptional

POI category (e.g. restaurant, cafe, park). Present for place results.

City stringoptional

City or town name. Present for address results.

Confidence float64optional

Interpolation confidence (0-1). Present only for interpolated results.

maximum1
minimum0
Country stringoptional

Country name. Present for reverse geocode address results.

CountryCode stringoptional

ISO 3166-1 alpha-2 country code

maxLength2
minLength2
DistanceM float64optional

Distance from the query point in meters (reverse geocode / nearby only)

FullAddress stringoptional

Complete formatted address from the database. Present for reverse geocode address results.

HouseNumber stringoptional

House or building number. Present for address and interpolated results.

Interpolated booloptional

Whether this result was estimated by address interpolation rather than an exact database match.

Name stringoptional

Place name (raw). Present for reverse geocode place results.

OsmID int64optional

OpenStreetMap element ID (null for interpolated results)

OsmType GeocodingFeaturePropertiesOsmTypeoptional

OSM element type (node, way, relation)

One of the following:
const GeocodingFeaturePropertiesOsmTypeNode GeocodingFeaturePropertiesOsmType = "node"
const GeocodingFeaturePropertiesOsmTypeWay GeocodingFeaturePropertiesOsmType = "way"
const GeocodingFeaturePropertiesOsmTypeRelation GeocodingFeaturePropertiesOsmType = "relation"
Postcode stringoptional

Postal code. Present for reverse geocode address results.

Score float64optional

Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1.

minimum0
Source GeocodingFeaturePropertiesSourceoptional

Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses)

One of the following:
const GeocodingFeaturePropertiesSourceStructured GeocodingFeaturePropertiesSource = "structured"
const GeocodingFeaturePropertiesSourceBm25 GeocodingFeaturePropertiesSource = "bm25"
const GeocodingFeaturePropertiesSourceFuzzy GeocodingFeaturePropertiesSource = "fuzzy"
const GeocodingFeaturePropertiesSourceAddress GeocodingFeaturePropertiesSource = "address"
const GeocodingFeaturePropertiesSourcePlace GeocodingFeaturePropertiesSource = "place"
const GeocodingFeaturePropertiesSourceInterpolation GeocodingFeaturePropertiesSource = "interpolation"
State stringoptional

State or province name. Present for reverse geocode address results.

Street stringoptional

Street name. Present for address and interpolated results.

Subcategory stringoptional

POI subcategory. Present for place results.

Tags map[string, string]optional

Raw OSM tags. Present for place results.

Wikipedia stringoptional

Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places.

Type GeocodingFeatureType
Type GeocodeResultType
type GeocodingFeature struct{…}

GeoJSON Feature representing a geocoding result. The geometry is always a Point. Properties include the formatted display name, OSM metadata, confidence score, and source type.

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

Coordinates GeoJsonGeometryCoordinatesUnion

Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc.

One of the following:
type GeoJsonGeometryCoordinatesPoint []float64

[longitude, latitude] or [longitude, latitude, elevation]

type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64

Array of [lng, lat] positions

type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64

Array of linear rings / line strings

type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64

Array of polygons

Type GeoJsonGeometryType

Geometry type

One of the following:
const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"
const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"
const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"
const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"
const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"
const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"
Properties GeocodingFeatureProperties

Geocoding result properties

DisplayName string

Formatted address or place name

Category stringoptional

POI category (e.g. restaurant, cafe, park). Present for place results.

City stringoptional

City or town name. Present for address results.

Confidence float64optional

Interpolation confidence (0-1). Present only for interpolated results.

maximum1
minimum0
Country stringoptional

Country name. Present for reverse geocode address results.

CountryCode stringoptional

ISO 3166-1 alpha-2 country code

maxLength2
minLength2
DistanceM float64optional

Distance from the query point in meters (reverse geocode / nearby only)

FullAddress stringoptional

Complete formatted address from the database. Present for reverse geocode address results.

HouseNumber stringoptional

House or building number. Present for address and interpolated results.

Interpolated booloptional

Whether this result was estimated by address interpolation rather than an exact database match.

Name stringoptional

Place name (raw). Present for reverse geocode place results.

OsmID int64optional

OpenStreetMap element ID (null for interpolated results)

OsmType GeocodingFeaturePropertiesOsmTypeoptional

OSM element type (node, way, relation)

One of the following:
const GeocodingFeaturePropertiesOsmTypeNode GeocodingFeaturePropertiesOsmType = "node"
const GeocodingFeaturePropertiesOsmTypeWay GeocodingFeaturePropertiesOsmType = "way"
const GeocodingFeaturePropertiesOsmTypeRelation GeocodingFeaturePropertiesOsmType = "relation"
Postcode stringoptional

Postal code. Present for reverse geocode address results.

Score float64optional

Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1.

minimum0
Source GeocodingFeaturePropertiesSourceoptional

Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses)

One of the following:
const GeocodingFeaturePropertiesSourceStructured GeocodingFeaturePropertiesSource = "structured"
const GeocodingFeaturePropertiesSourceBm25 GeocodingFeaturePropertiesSource = "bm25"
const GeocodingFeaturePropertiesSourceFuzzy GeocodingFeaturePropertiesSource = "fuzzy"
const GeocodingFeaturePropertiesSourceAddress GeocodingFeaturePropertiesSource = "address"
const GeocodingFeaturePropertiesSourcePlace GeocodingFeaturePropertiesSource = "place"
const GeocodingFeaturePropertiesSourceInterpolation GeocodingFeaturePropertiesSource = "interpolation"
State stringoptional

State or province name. Present for reverse geocode address results.

Street stringoptional

Street name. Present for address and interpolated results.

Subcategory stringoptional

POI subcategory. Present for place results.

Tags map[string, string]optional

Raw OSM tags. Present for place results.

Wikipedia stringoptional

Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places.

Type GeocodingFeatureType
type ReverseGeocodeResult struct{…}

GeoJSON FeatureCollection of reverse geocoding results, ordered by distance from the query point. Content-Type: application/geo+json.

Features []GeocodingFeature

Reverse geocoding results ordered by distance

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

Coordinates GeoJsonGeometryCoordinatesUnion

Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc.

One of the following:
type GeoJsonGeometryCoordinatesPoint []float64

[longitude, latitude] or [longitude, latitude, elevation]

type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64

Array of [lng, lat] positions

type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64

Array of linear rings / line strings

type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64

Array of polygons

Type GeoJsonGeometryType

Geometry type

One of the following:
const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"
const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"
const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"
const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"
const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"
const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"
Properties GeocodingFeatureProperties

Geocoding result properties

DisplayName string

Formatted address or place name

Category stringoptional

POI category (e.g. restaurant, cafe, park). Present for place results.

City stringoptional

City or town name. Present for address results.

Confidence float64optional

Interpolation confidence (0-1). Present only for interpolated results.

maximum1
minimum0
Country stringoptional

Country name. Present for reverse geocode address results.

CountryCode stringoptional

ISO 3166-1 alpha-2 country code

maxLength2
minLength2
DistanceM float64optional

Distance from the query point in meters (reverse geocode / nearby only)

FullAddress stringoptional

Complete formatted address from the database. Present for reverse geocode address results.

HouseNumber stringoptional

House or building number. Present for address and interpolated results.

Interpolated booloptional

Whether this result was estimated by address interpolation rather than an exact database match.

Name stringoptional

Place name (raw). Present for reverse geocode place results.

OsmID int64optional

OpenStreetMap element ID (null for interpolated results)

OsmType GeocodingFeaturePropertiesOsmTypeoptional

OSM element type (node, way, relation)

One of the following:
const GeocodingFeaturePropertiesOsmTypeNode GeocodingFeaturePropertiesOsmType = "node"
const GeocodingFeaturePropertiesOsmTypeWay GeocodingFeaturePropertiesOsmType = "way"
const GeocodingFeaturePropertiesOsmTypeRelation GeocodingFeaturePropertiesOsmType = "relation"
Postcode stringoptional

Postal code. Present for reverse geocode address results.

Score float64optional

Relevance score (higher is better). Incorporates text match quality, spatial proximity boost, and popularity signals. Not bounded to 0-1.

minimum0
Source GeocodingFeaturePropertiesSourceoptional

Result source indicating how the result was found: structured (exact field match), bm25 (full-text search), fuzzy (trigram similarity), address (reverse geocode address), place (reverse geocode POI), interpolation (estimated from neighboring addresses)

One of the following:
const GeocodingFeaturePropertiesSourceStructured GeocodingFeaturePropertiesSource = "structured"
const GeocodingFeaturePropertiesSourceBm25 GeocodingFeaturePropertiesSource = "bm25"
const GeocodingFeaturePropertiesSourceFuzzy GeocodingFeaturePropertiesSource = "fuzzy"
const GeocodingFeaturePropertiesSourceAddress GeocodingFeaturePropertiesSource = "address"
const GeocodingFeaturePropertiesSourcePlace GeocodingFeaturePropertiesSource = "place"
const GeocodingFeaturePropertiesSourceInterpolation GeocodingFeaturePropertiesSource = "interpolation"
State stringoptional

State or province name. Present for reverse geocode address results.

Street stringoptional

Street name. Present for address and interpolated results.

Subcategory stringoptional

POI subcategory. Present for place results.

Tags map[string, string]optional

Raw OSM tags. Present for place results.

Wikipedia stringoptional

Wikipedia article reference (e.g. en:Eiffel Tower). Present for notable places.

Type GeocodingFeatureType
Type ReverseGeocodeResultType