Documentation

Structured search

Geocoding from separate address fields.

GET /v1/search/structured takes the parts of an address in separate fields. Set at least one of address, locality, region, postalcode or country; otherwise the request fails with 400.

Parameters

ParameterTypeMeaning
addressstringHouse number and street, or a venue name.
neighbourhoodstringNeighbourhood.
boroughstringBorough.
localitystringCity or town.
countystringCounty.
regionstringState or province.
postalcodestringPostal code.
countrystringCountry name, or an ISO 3166-1 alpha-2 code. A two-letter code filters by country instead of matching words.

size, layers, boundary.country and the focus point work as in Search.

Example

curl 'http://localhost:4000/v1/search/structured?address=10%20Downing%20Street&country=GB&size=1'
{
  "features": [
    {
      "geometry": {
        "coordinates": [
          -0.1276324,
          51.5033364
        ],
        "type": "Point"
      },
      "properties": {
        "confidence": 1.0,
        "country": "United Kingdom",
        "country_code": "GB",
        "county": "Westminster",
        "gid": "geolith:venue:-7368694405765891336",
        "id": "-7368694405765891336",
        "importance": 0.9613999724388123,
        "label": "10 Downing Street, England, United Kingdom",
        "layer": "venue",
        "name": "10 Downing Street",
        "region": "England",
        "source": "geolith"
      },
      "type": "Feature"
    }
  ],
  "geocoding": {
    "attribution": "https://search.geolith.app/attribution",
    "engine": {
      "name": "geolith-search",
      "version": "0.1.0"
    },
    "query": {
      "fields": [
        "10 Downing Street",
        "GB"
      ],
      "ranking": "importance",
      "size": 1,
      "tinql": "\"10\" AND \"downing\" AND \"street\""
    },
    "version": "0.2"
  },
  "type": "FeatureCollection"
}

Every word of every field is required first. When that finds nothing, the query relaxes to about three quarters of the words.