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
This article focuses on the different ways to technically implement a Product Locator on your platform. [...]
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 [...]
Dans le secteur du voyage et de l'hôtellerie, tous les parcours des clients commencent par une destinat [...]
In the travel and hospitality business, all customer journeys begin with a physical destination. Theref [...]
and don't miss a single one of our news