Search API

Samples

Search samples

For 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:public_key, query:'type:"grocery"', lat:43.3, lng:3.883, radius:3000},
    success: function(data) { 
        console.log(data.features); 
    }
});