"Filter" query
The query parameter filter
can be sent multiple times. It is an array parameter.
The API will only return the records that matches every filter sent in the request.
The filters are applied to the $.info
section of the record only, for dist
, lat
, lon
and gh
there are specific
query parameters in the API.
Let's look at the following example of a Steak House nearby Buenos Aires city center:
[
{
"dist": 92.4,
"gh": "69y7pkx1dc",
"id": 915725327,
"info": {
"addr:city": "Ciudad Autónoma de Buenos Aires",
"addr:country": "AR",
"addr:housenumber": "1124",
"addr:street": "Avenida Corrientes",
"amenity": "bar",
"cuisine": "steak_house",
"name": "Revire",
"opening_hours": "Mo-Su 12:00-01:00"
},
"lat": -34.60392,
"lon": -58.3826
}
]
Let's suppose you know the name of the place and the fact it is a steak house, you could look up for this particular
Point of Interest by filtering:
cousine=steak_house
, name=Revire*
and addr:city=~*buenos*aires*
.
The *
will do a wildcard matching.
The ~
will make the filter case-insensitive. i.e. ~Buenos Aires
, ~BUENOS AIRES
, ~buenos aires
, will all match Buenos Aires
.
If not specified, filters are case-sensitive by default. It must be the first character in the filter.
To further clarify, if you want to lookup for Buenos
anywhere in the city name, you could do: addr:city=~*buenos*