Skip to content

Points of Interest

Stable
Available in the US and Canada

GET v3/pois

Points of interest (POIs) near a location can be accessed via Local Logic’s POIs endpoint, documented below. POIs will be returned in order of least to greatest linear_distance away from the specified lat/lng (or the center of the specified polygon) for each respective POI category.

GET v3/pois

The following categories of POIs are available.

CategoryPOI Category Name
Art, Culture and Scienceart_culture_science
Airportsairports
Bus Stopsbus_stops
Cafescafes
Car Fueling Stationscar_fueling_stations
Daycaresdaycares
Fitnessfitness
Groceries (General)groceries
Groceries (Specialized)groceries_specialized
Health Carehealth_care
Healthy Restaurantshealthy_restaurants
Home Improvementhome_improvement
Nightlifenightlife
Parksparks
Personal Carepersonal_care
Pet Carepet_care
Rapid Transit Stationsrapid_transit_stations
Restaurantsrestaurants
Shoppingshopping
Sport Facilitiessport_facilities
Train Stationstrain_stations

V3 Header Request Parameters

This API uses JWT token based authentication. This JWT Bearer token is what is used to populate the Authorization header below.

Instructions on how to retrieve this token can be found at Accessing the API → V3 API Authorization.

HeaderStatusDescription
AuthorizationrequiredYour bearer token retrieved from our authorization API, ex. Bearer eyJhbGci...
AcceptrequiredThe datatype to request, this API will return application/json.

V3 QueryString Request Parameters

The region to be queried by the endpoint can be defined two ways: (1) by specifying a lat/lng coordinate, with optional radius parameters, (2) or by providing a polygon parameter.

When using the lat/lng coordinate query method without specifying radius parameter, the endpoint will return points of interest within 5km of the coordinates. When including radius parameters, the resulting circular area around the lat/lng coordinate will be queried.

When using the polygon query method, the points of interest returned will be contained in the region defined by the polygon area. Polygons are specified using the WKT format. The only accepted type is POLYGON, and holes are not supported. Each polygon point must be defined as a lng/lat coordinate.

API Limitations

  1. The polygon query string has been limited to 5000 chars.
  2. The polygon must fit inside a bounding box with a diagonal distance of less than 70km between its southwest and northeast corners.
  3. The radius is limited to 25km.

Up to 30 POIs can be obtained per category when multiple categories are called through the API. When a single category of POIs is requested in the parameters, up to 500 POIs will be returned.

proximity.walking data, including walking distance and walking travel_time is currently only available for the 5 closest POIs for each category. The quality value represents whether the data is calculated or estimated.

Warning

⚠️ WKT works on x/y planes. Therefore, the coordinates must be sent as `lng`/`lat` instead of `lat`/`lng`.
ParameterStatusDescription
latoptionalA decimal number between -90 and 90 (Latitude)
lngoptionalA decimal number between -180 and 180 (Longitude)
radiusoptionalA positive float number (Circle radius)
polygonoptionalList of 2D lng/lat points that define a 2D polygon, using the WKT representation
includerequiredA comma separated list of POI category names. See the above table's POI Category Name column for a full list of available categories.
limitoptionalThe limit of POIs returned per POI category.

default: 30

maximum: 30 if multiple POI categories specified in the include parameter, otherwise 500 if only one single POI category

V3 NodeJS Example

require('node-fetch')('https://api.locallogic.co/v3/pois?' + new URLSearchParams({
lat: 41.847206,
lng: -87.668825,
include: 'cafes,bus_stops',
radius: 3000,
limit: 10
}), {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: 'Bearer eyJhbGciOiJ...'
}
})
.then(response => response.json())
.then(body => {
console.log(body)
})
.catch(error => {
console.log(error)
})

V3 Python Example

import requests
response = requests.get(
"https://api.locallogic.co/v3/pois",
headers={
"Accept": "application/json",
"Authorization": "Bearer eyJhbGciOiJ..."},
params={
"lat": 43.593611,
"lng": -79.536194,
"include": 'cafes,bus_stops',
"radius": 3000,
"limit": 10
}
)
print(response.json())

200 - V3 Response Example

{
"data": {
"cafes": [
{
"name": "Tim Hortons",
"address": "11940 111 Ave Nw",
"city": "Edmonton",
"province": "AB",
"postalcode": "T5G0E5",
"country": "Canada",
"lat": 53.559654,
"lng": -113.528046,
"url": "http://timhortons.com/ca",
"proximity": {
"linear_distance": 0.491,
"walking": {
"quality": "calculated",
"distance": 0.522,
"travel_time": 6
}
}
},
{
"name": "European Sweetness Ltd",
"address": "12212 107 Ave Nw",
"city": "Edmonton",
"province": "AB",
"postalcode": "T5M4A8",
"country": "Canada",
"lat": 53.551163,
"lng": -113.53287,
"proximity": {
"linear_distance": 0.613,
"walking": {
"quality": "calculated",
"distance": 1.001,
"travel_time": 12
}
}
},
{
"name": "Second Cup",
"address": "11640 104 Ave Nw",
"city": "Edmonton",
"province": "AB",
"postalcode": "T5K2T7",
"country": "Canada",
"lat": 53.547203,
"lng": -113.52228,
"url": "http://secondcup.com",
"proximity": {
"linear_distance": 0.95,
"walking": {
"quality": "calculated",
"distance": 1.029,
"travel_time": 12
}
}
},
// Plus other cafes
],
"bus_stops": [
{
"name": "119 Street & 111 Avenue",
"country": "Canada",
"lat": 53.558764,
"lng": -113.526336,
"routes": [
{
"short_name": "125",
"long_name": "Belvedere - Jasper Place",
"route_color": "#FFFFFF",
"text_color": "#000000"
}
],
"proximity": {
"linear_distance": 0.386
}
},
// Plus other bus_stops
]
},
"meta": {
"message": "Successfully called v3/pois API.",
"type": "LocalLogic.API.Success",
"statusCode": 200,
"counts": {
"cafes": 10,
"bus_stops": 10
}
}
}
© Local Logic 2024