---
title: "Autocompletion & geocoding that resolves user input addresses including coordinates"
method: GET
path: "/api/v1/geocode"
tags: ["geocode"]
---

# Autocompletion & geocoding that resolves user input addresses including coordinates

`GET /api/v1/geocode`

## Query parameters

- `text` string, required
- `language` string[]
- `type` LocationType[]
- `mode` Mode[]
- `place` string
- `placeBias` number
- `numResults` integer
- `min` string
- `max` string

## Response `200`

A list of guesses to resolve the text to a location

- Match[]
  - `type` 'ADDRESS' | 'PLACE' | 'STOP', required — location type
  - `category` string — Experimental. Type categories might be adjusted. For OSM stop locations: the amenity type based on https://wiki.openstreetmap.org/wiki/OpenStreetMap_Carto/Symbols
  - `tokens` Token[], required — list of non-overlapping tokens that were matched
    - number[] — Matched token range (from index, length)
  - `name` string, required — name of the location (transit stop / PoI / address)
  - `id` string, required — unique ID of the location
  - `lat` number, required — latitude
  - `lon` number, required — longitude
  - `level` number — level according to OpenStreetMap (at the moment only for public transport)
  - `street` string — street name
  - `houseNumber` string — house number
  - `country` string — ISO3166-1 country code from OpenStreetMap
  - `zip` string — zip code
  - `tz` string — timezone name (e.g. "Europe/Berlin")
  - `areas` Area[], required — list of areas
    - `name` string, required — Name of the area
    - `adminLevel` number, required — [OpenStreetMap `admin_level`](https://wiki.openstreetmap.org/wiki/Key:admin_level) of the area
    - `matched` boolean, required — Whether this area was matched by the input text
    - `unique` boolean — Set for the first area after the `default` area that distinguishes areas if the match is ambiguous regarding (`default` area + place name / street [+ house number]).
    - `default` boolean — Whether this area should be displayed as default area (area with admin level closest 7)
  - `score` number, required — score according to the internal scoring system (the scoring algorithm might change in the future)
  - `modes` Mode[] — available transport modes for stops
  - `importance` number — importance of a stop, normalized from [0, 1]

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/motis-project/apis/motis-api.md) · [All operations](https://skmtc.net/motis-project/apis/motis-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/motis-project/motis-api/revisions/faf7ed029357/schema)
