Woosmap Data API now open for backend development

July 12, 2016 on changelog.

jsfiddle samples on woosmap documentation

The Woosmap Data API enables you to develop websites and applications to retrieve and display search results from your locations data programmatically. With this API, you can use RESTful requests from backend development to get woosmap location search results in JSON format. A typical usage could be, as described in the above schema, to retrieve the nearby locations from a known web user and then request a service that fetches the product availability for each store.

How to use it

On Woosmap developers documentation you’ll find all necessary information to work with this service. You can request the API passing two kinds of parameters:

  • Geographic parameters: around a geographical point using lat, lng (that could be retrieved using our recommendation API for user location) and a max_distance parameters or nearby a polyline using encoded_polyline and inside a defined radius parameter.

  • Attributes parameters: based on location attributes idstore, name, city, type (to select only stores with click & collect capabilities, for example) and tag.

Python sample request

The following sample returns the stores less than 50km (max_distance = 50000) from a user located in Brussels, Belgium (user_position = {'lat': 50.840, 'lng': 4.348})

import requests

private_key = 'z6a4f926-58c3-41a8-4b2b-24ee682fef01'  # your private key here
endpoint_api = 'https://api.woosmap.com/stores/search'
user_position = {'lat': 50.840, 'lng': 4.348}  # a given user position
max_distance = 50000  # value in meters

session = requests.Session()
response = session.get(endpoint_api,
                       params={'private_key': private_key,
                               'lat': user_position['lat'],
                               'lng': user_position['lng'],
                               'max_distance': max_distance})

Why only use it on backend side?

This RESTful API is only supported for backend development because you’ll need to attach to each request your private_key parameter. This key must stay private as it allows to manage all your locations data. This way, you’ll prevent malicious use of this service, like ill-intentioned developers to delete all your data.


Javascript Samples on Woosmap developers documentation hosted on JSFiddle

On Woosmap documentation for developers you can find a lot of samples to understand how to use each part of our Javascript API. Under this section we now use JSFiddle, an online code playground that provides a customized environment (based on user selections) to test (or fiddle with) your JavaScript, HTML, and CSS code right inside your browser. Each JSFiddle sample uses code hosted on GitHub on our Woosmap organisation.


Bulk Geocode addresses using Google Maps and GeoPy

Geocoding is the process of converting addresses (like a street address) into geographic coordinates (like latitude and longitude). With Woosmap you can request nearby location or display on a map a lot of geographic elements like stores or any other point of interest. To take advantages of these features, you first have to push geocoded locations to our system, as we discussed in this previous post. Most of the time, your dataset has addresses but no location information.