Skip to content

Returns a list of baskets close to a given location. If the location is not valid the user's home location is used. The distance is measured in kilometers.

GET
/api/baskets/nearby

Does not include baskets created by the current user.

Returns 200 and a list of baskets, 400 if the distance is out of range, or 401 if not logged in.

Authorizations

api_key
Type: API Key (header: X-CSRF-Token)

Parameters

Query Parameters

lat
Typestring
lon
Typestring
distance
Typestring

Responses

Authorization
api_key
Variables
Key
Value
lat
lon
distance
cURL
curl -X GET \
'http://localhost/api/baskets/nearby'

Samples

cURL
curl -X GET http://localhost/api/baskets/nearby
JavaScript
fetch("http://localhost/api/baskets/nearby")
  .then(response => response.json())
  .then(data => console.log(data));
PHP
file_get_contents("http://localhost/api/baskets/nearby");
Python
import requests
response = requests.get("http://localhost/api/baskets/nearby")
print(response.json())