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.
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 Geolocation 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
.
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})
response.json()
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.
If you want to go further
Let's start by putting in place the Woosmap Map API! In the video below, you will learn how to implemen [...]
With the help of use cases using Localities API and Data Management API, Gaël Simon (DevRel Lead at Woo [...]
Distance API will give you the walking, driving, and cycling distance and path to access the destinatio [...]
Woosmap Multisearch JS Library helps you integrate alocation search box as effectively as possible and [...]
*Ding* Uber Eats: Your delivery driver is heading your way. A smile forms. *Ding* Decathlon: Your order [...]
À l'ère des véhicules électriques, le défi de se rendre d’un point A à un point B est toujours d'actual [...]
and don't miss a single one of our news