Samples
Search samplesFor all the following examples, you have to use this URL:
https://api.woosmap.com/stores/search/?private_key={private_key}&query='your_query'
To test your query, we recommend the use of cURL. Postman could be a good alternative for people who are not familiar with command line tool.
Sample data
{
"stores": [
{
"store_id": "first",
"name": "My cool store",
"tags": ["grocery", "apple"],
"user_properties": {
"rating": 3,
"seats": 345
}
},
{
"store_id": "second",
"name": "My Second Store",
"tags": ["lightsaber", "samsung"],
"user_properties": {
"rating": 5
}
}
]
}
Sample Queries
Search for assets which have a user property rating greater than 3
:
user.rating:>3 //matches My cool store
Search for assets which have a user property rating equal to 5
:
user.rating:5 //matches My Second Store
Search for assets which have idstore
corresponding to My cool store
and seats
from user_properties
is equal to 345
idstore:="My cool store" AND user.seats:345
Search for assets which have idstore
corresponding to My cool store
and seats
from user_properties
is equal to 300
idstore:="My cool store" AND user.seats:>300
Search for assets which have idstore
corresponding to My cool store
and seats
from user_properties
is smaller than 400
idstore:="My cool store" AND user.seats:<400
Search for assets which doesn’t have the grocery
type.
NOT type:"grocery"
Sample Javascript Call
This snippet represent a search call from a client application using jQuery Javascript library.
Search for assets which have the grocery
type and are within a three-kilometre radius of a given point:
$.ajax({
url: 'https://api.woosmap.com/stores/search/',
type: 'GET',
dataType:'json',
data: {key:[YOUR_PUBLIC_KEY], query:'type:"grocery"', lat:43.3, lng:3.883, radius:3000},
success: function(data) {
console.log(data.features);
}
});
Sample Autocomplete Search API
Here we assume that the user typed commercial
and we send his request with the parameter language
set to it
.
https://api.woosmap.com/stores/autocomplete/?key={public_key}&query=localized=commercial&language=it
For this query the Autocomplete API will return the following content:
{
"predictions": [
{
"store_id": "CI341",
"name": "Centro Commerciale Deria",
"types": [
"CI"
],
"matched_substrings": [
{
"offset": 7,
"length": 10
}
],
"highlighted": "Centro <b>Commercial</b>e Deria"
},
{
"store_id": "CI436",
"name": "Centro Commerciale Velizy",
"types": [
"CI"
],
"matched_substrings": [
{
"offset": 7,
"length": 10
}
],
"highlighted": "Centro <b>Commercial</b>e Velizy"
},
{
"store_id": "CI1524",
"name": "Centro Commerciale K11",
"types": [
"CI"
],
"matched_substrings": [
{
"offset": 7,
"length": 10
}
],
"highlighted": "Centro <b>Commercial</b>e K11"
},
{
"store_id": "CI2782",
"name": "Centro Commerciale City2",
"types": [
"CI"
],
"matched_substrings": [
{
"offset": 7,
"length": 10
}
],
"highlighted": "Centro <b>Commercial</b>e City2"
},
{
"store_id": "CI1972",
"name": "Centro commerciale Domus",
"types": [
"CI"
],
"matched_substrings": [
{
"offset": 7,
"length": 10
}
],
"highlighted": "Centro <b>commercial</b>e Domus"
}
]
}