Documentation

Search

Forward geocoding: find places that match free text.

GET /v1/search finds places and addresses that match free text.

Parameters

ParameterTypeDefaultMeaning
textstringrequiredPlace name, address, or both. Only letters and digits count; at most 12 words are used.
sizeinteger 1–4010Number of results.
layerslistbothComma-separated: venue (points of interest), address (street addresses).
boundary.countrylistevery countryComma-separated ISO 3166-1 alpha-2 codes, any case.
focus.point.latnumber −90–90noneLatitude of a point whose surroundings rank higher. Set with focus.point.lon.
focus.point.lonnumber −180–180noneLongitude of that point. Set with focus.point.lat.

Example

curl 'http://localhost:4000/v1/search?text=eiffel%20tower&focus.point.lat=48.8566&focus.point.lon=2.3522&size=1'
{
  "features": [
    {
      "geometry": {
        "coordinates": [
          2.3473009,
          48.8489712
        ],
        "type": "Point"
      },
      "properties": {
        "confidence": 1.0,
        "country": "France",
        "country_code": "FR",
        "county": "Paris",
        "distance": 0.921,
        "gid": "geolith:venue:7437554776554892439",
        "id": "7437554776554892439",
        "importance": 0.8188999891281128,
        "label": "Eiffel Tower, Paris, Île-de-France, France",
        "layer": "venue",
        "locality": "Paris",
        "name": "Eiffel Tower",
        "region": "Île-de-France",
        "source": "geolith"
      },
      "type": "Feature"
    }
  ],
  "geocoding": {
    "attribution": "https://search.geolith.app/attribution",
    "engine": {
      "name": "geolith-search",
      "version": "0.1.0"
    },
    "query": {
      "ranking": "importance+distance",
      "size": 1,
      "text": "eiffel tower",
      "tinql": "\"eiffel\" AND \"tower\""
    },
    "version": "0.2"
  },
  "type": "FeatureCollection"
}

Notes

  • Every word is required first. If that finds fewer than size places, the query relaxes to about three quarters of the words. See Ranking.
  • With a focus point, nearby places rank higher and each result has a distance in kilometres.