GET /v1/search finds places and addresses that match free text.
Parameters
| Parameter | Type | Default | Meaning |
|---|---|---|---|
text | string | required | Place name, address, or both. Only letters and digits count; at most 12 words are used. |
size | integer 1–40 | 10 | Number of results. |
layers | list | both | Comma-separated: venue (points of interest), address (street addresses). |
boundary.country | list | every country | Comma-separated ISO 3166-1 alpha-2 codes, any case. |
focus.point.lat | number −90–90 | none | Latitude of a point whose surroundings rank higher. Set with focus.point.lon. |
focus.point.lon | number −180–180 | none | Longitude 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
sizeplaces, 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
distancein kilometres.