Skip to content

Autocomplete Endpoint

The Autocomplete API provides instant place and address suggestions based on partial user input. It is typically used in search boxes where results update in real time.

How it Works

  • Send a partial query (text) such as "YMCA".
  • The API returns a list of matching places (venues, streets, cities, etc.) with coordinates and metadata.
  • You can restrict search by location using boundary parameters.
  • Important: You must include a valid token parameter in the request.
    If missing or invalid, the API will return 401 Token required.

Endpoint

GET https://gateway.mapmetrics-atlas.net/autocomplete

Parameters

Search API Parameters

ParameterTypeReqExampleDescription
textstringUnion SquareThe search query text.
tokenstring (auth token)abcd1234Required authentication token, otherwise request returns 401 Token required.
focus.point.latfloat48.581755Latitude for search focus.
focus.point.lonfloat7.745843Longitude for search focus.
boundary.rect.min_lonfloat139.2794Minimum longitude of bounding box.
boundary.rect.max_lonfloat140.1471Maximum longitude of bounding box.
boundary.rect.min_latfloat35.53308Minimum latitude of bounding box.
boundary.rect.max_latfloat35.81346Maximum latitude of bounding box.
boundary.circle.latfloat43.818156Circle boundary center latitude.
boundary.circle.lonfloat-79.186484Circle boundary center longitude.
boundary.circle.radiusfloat35Circle radius (in kilometers).
sourcesstring (comma-separated)openstreetmap,wofData sources to include.
layersstring (comma-separated)address,venueFeature layers to include.
boundary.countrystring (comma-separated)GBR,FRAISO country codes to limit search.
boundary.gidPelias gidwhosonfirst:locality:101748355Restrict results to a specific boundary by gid.
sizeinteger20Number of results to return.

Example

bash
GET https://gateway.mapmetrics-atlas.net/autocomplete/?text=YMCA&boundary.circle.lon=-79.186484&boundary.circle.lat=43.818156&boundary.circle.radius=35&token=YOUR_API_KEY

Example Response

json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [-78.861037, 43.900526]
      },
      "properties": {
        "name": "Durham Family YMCA",
        "country": "Canada",
        "region": "Ontario",
        "locality": "Oshawa",
        "label": "Durham Family YMCA, Oshawa, ON, Canada"
      }
    }
  ]
}