Want to access your store data programmatically? Blipstar has a very simple API (Application Programming Interface) whereby you supply a map co-ordinate and it returns a list of your nearest stores. How does it work? Your web application fires off a basic HTTP request and receives a response in JSON format. It's then up to you to manipulate the data as required.
The code on your server sends a simple HTTP GET request.
Example 1https://viewer.blipstar.com/api/?uid=[YOURACCOUNTID]&lat=37.774&lng=-122.419&results=5
The above example is asking for the nearest 5 results to map location 37.774,-122.419 (San Francisco)
Example 2https://viewer.blipstar.com/api/?uid=[YOURACCOUNTID]&search=New+York&radius=100&results=25&tag=flagship&country=usa
The above example is requesting stores within 100km of New York containing the tag Flagship and only in the USA (so Canadian stores would not be returned). In addition a maximum of 25 results should be returned.
A few things to note:Parameter | Explanation | Example |
---|---|---|
uid | Your unique Blipstar account id | 2857242 |
lat | Latitude (decimal degrees, -90 to 90) | 87.512454 |
lng | Longitude (decimal degrees, -180 to 180) | 163.922620 |
search | Location to search for (if not supplying lat and lng) | Orlando,FL |
results | Number of results to return | 3 |
Optional parameters... | ||
radius | Search radius (in km). Return stores located with [radius] km of lat-lng. | 50 |
country | Limit results to stores within this country (uses each store's Country field) | canada |
state | Limit results to stores within this state/province (uses each store's State field) | bc |
tag | Limit results to stores with this tag (uses store's Tag field - if more than one, separate with a comma) | menswear |
tag2 | Limit results to stores with this tag from your second group of tags |
The API returns JSON, containing a simple array of store locations. If no matching stores were found the array will be empty. The following example contains two results.
Example (success)[ { "n": "Wonderland Store", "s": "MA", "c": "United States", "ad": "10 Made Up Drive, MA, 91867, United States", "pc": "91867", "p": "(555) 123 4567", "w": "www.madeupsite.com/wonderland/product2", "m1": "Now Open Sundays!", "dist": "6.5", "lat": 42.310687, "lng": -71.180077 }, { "n": "Super World", "s": "MA", "c": "United States", "ad": "1943 Nowhere Street, MA, 92665, United States", "pc": "92665", "p": "(555) 765 4321", "dist": "17.2", "lat": 42.83453, "lng": -70.72347 } ]Example (error)
{ "error": "Invalid UID (it should be your unique Blipstar account ID)" }
Fields | Value |
---|---|
n | Store name |
dist | Distance (from search location) |
ad | Address |
pc | Postal/Zip code |
s | State/Province |
c | Country |
p | Phone number |
e | |
w | Website |
m1 | Misc 1 |
m2 | Misc 2 |
m3 | Misc 3 |
m4 | Misc 4 |
i | Icon |
lg | Logo |
pty | Priority |
mon | Monday opening times |
tue | Tuesday opening times |
wed | Wednesday opening times |
thu | Thursday opening times |
fri | Friday opening times |
sat | Saturday opening times |
sun | Sunday opening times |
tg | Tag(s) |
tg2 | Second group of Tag(s) |
tg3 | Third group of Tag(s) |
rg | Sales regions (postal codes) |
We've made the API as simple to set up as possible but if you do encounter any issues just let us know.