Skip to main content

Profiles

Stable
English and FrenchUS 🇺🇸 and Canada 🇨🇦

Use this endpoint to retrieve the Local Profiles of a specific location using an identifier.

Profiles can be retrieved by supplying the specific geog_id, or by supplying a lat and lng coordinate pair as arguments. See below for examples.

info

French translations are only available for Canadian locations.

GET v3/profiles​

GET v3/profiles

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 Getting Started.

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

QueryString​

GET v3/profiles?lat={lat}&lng={lng}
ParameterStatusDescription
latrequired*A decimal number between -90 and 90, representing the latitude.
lngrequired*A decimal number between -180 and 180, representing the longitude.
localeoptionalString value representing the language to return the profiles in.
Available:en (English), fr (French)
Default: en

GET v3/profiles/{geog_id}​

Accepted values for geog_id are g10_*, g20_* and g30_*. Other values will result with a 404 (not found) status code.

GET v3/profiles/{geog_id}

Header​

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 Getting Started.

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

QueryString​

ParameterStatusDescription
localeoptionalString value representing the language to return the profiles in.
Available:en (English), fr (French)
Default: en

Usage examples​

require('node-fetch')('https://api.locallogic.co/v3/profiles/g20_f25dyhf3?' + new URLSearchParams({
locale: 'en',
}), {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: 'Bearer eyJhbGciOiJ...'
}
})
.then(response => response.json())
.then(body => {
console.log(body)
})
.catch(error => {
console.log(error)
})

Response example​

{
"data": {
"bounding_box": {
"east": -73.51738361127795,
"north": 45.53938230417042,
"south": 45.48710983364872,
"west": -73.60695342963047
},
"centroid": {
"lat": 45.5097221239011,
"lng": -73.56099384933795
},
"id": "g20_f25dyhf3",
"intro": "The borough of Ville-Marie can be found in the city of Montréal, Quebec, which is situated in the Greater Montreal metropolitan area.",
"name": "Ville-Marie",
"profiles": {
"character": "Ville-Marie is a great part of Montréal for home buyers who enjoy both indoor and outdoor activities. Finding things to do is very easy in this area. There is a broad selection of entertainment venues, the streets are very often busy with people, and with its over 100 nightlife venues, there are options for nighttime activities. Rue Saint-Paul is among the most lively streets in this area. There is a good amount of greenery in this part of Montréal; it is very easy to get to green spaces in the borough since there are over 50 of them close by for residents to visit. In addition, residents will find that the majority of streets have reasonably good tree coverage.",
"housing": "In Ville-Marie, most dwellings are large apartment buildings, while small apartment buildings are also present in the housing stock. Around 30% of homes in this borough were constructed pre-1960, while many of the remaining buildings were built in the 1960s and the 1980s. This part of Montréal offers mainly two bedroom and one bedroom homes. Renters occupy roughly 70% of the dwellings in Ville-Marie and owners occupy the remainder.",
"services": "Both general and specialty grocery stores are usually accessible within a short walk from anywhere in this part of the city. There are over 100 supermarkets in Ville-Marie, and the best selection can be found on streets such as Avenue du Parc. Moreover, thanks to 1000-odd restaurants and cafes in Ville-Marie, there is typically a place to get a meal or beverage just around the corner. Residents benefit from a very large number of nearby clothing stores. With respect to education, in Ville-Marie, parents and their kids will usually be able to access schools and daycares by walking.",
"summary": "Ville-Marie in Montréal, Quebec is a vibrant neighborhood that offers easy access to public transportation, a plethora of diverse dining options, and convenient grocery and shopping locations. The area is also known for its bike-friendly infrastructure and plenty of green spaces for outdoor activities. With a bustling nightlife and a variety of entertainment venues, residents can easily find things to do. The housing stock primarily consists of large apartment buildings, offering a range of options for renters and owners. Ville-Marie is perfect for those seeking a lively and accessible neighborhood with a rich urban atmosphere.",
"transport": "Regardless of the means of transportation, it is very simple to move around in Ville-Marie. The great public transit access makes transit a viable option for many due to plenty of nearby rapid transit stations with access to the Orange Line, Green Line and Yellow Line, and over 50 nearby bus lines. Physically active home buyers will also be pleased with the very walk-friendly nature of this area; running common errands is very convenient, and various businesses are reasonably nearby. Ville-Marie is bicycling-friendly since the bicycling network is quite extensive, and bike-share stations are hardly ever more than a short walk away."
},
"type": "profiles"
},
"meta": {
"geometry": [],
"sections": {
"character": "Character",
"housing": "Housing",
"services": "Services",
"summary": "Summary",
"transport": "Transportation"
}
}
}
info

Important: Make sure to display information under data.attributes.* as HTML.

SDK Implementations​

Profiles is used by three Local Logic SDKs:

SDKDescription
Local Profiles SDKRetrieves the name of the neighborhood as well as the characteristics paragraphs summarizing each neighborhood’s Transportation, Services, and Character.
NeighborhoodHero SDKRetrieves the name of the neighborhood and the neighborhood summary text.
NeighborhoodCharacteristics SDKRetrieves the characteristics paragraphs summarizing each neighborhood’s Transportation, Services, and Character.

Error codes​

When calling Local Logic’s API, you may receive an HTTP error code. These errors are explained below. In general, error codes starting with “4” are due to an invalid API call and can be fixed on your end, whereas error codes starting with “5” are due to server errors (that is, problems on our end). If you receive something not described here, please contact us at support@locallogic.co.

400 - BadRequest

This error code happens when the request inputs are incorrect. Use the detail field of the response for clarification. Example:

{
"code": "LocalLogic.API.BadRequest",
"detail": "ValidationErrors: AroundEndpoint is invalid:\n\tinclude is invalid: \"bad_input\" is not an acceptable value: \"groceries\", \"restaurants\", \"nightlife\", \"cafes\", \"shopping\", \"daycares\", \"primary_schools\", \"high_schools\""
}

401 - Unauthorized

This error code happens when your API key cannot access specific resources or locations. For example, some API keys can only access certain countries / states / provinces. Feel free to contact us for more information. Example:

{
"code": "LocalLogic.API.Unauthorized",
"detail": "Your API KEY doesn't support this region"
}

403 - Forbidden

This error code happens when you forgot to include security credentials with your request or you are requesting a parameter that you do not have access to. Example:

{
"message": "Forbidden"
}

404 - NotFound

This error code happens when we don’t have data for the requested location. For example, if you send a lat/lng pair for a location in Antarctica, we will return this error as we don’t have data for Antarctica (yet!). Example:

{
"code": "LocalLogic.API.NotFound",
"detail": "No Location Scores found for this location."
}

422 - Unprocessable Entity

This error code is returned when the correct parameters have been sent however, the data they contain is not valid. For example, if you send a lat/lng pair and the latitude is invalid (ie. not in the range [-90, 90]) and/or the longitude is invalid (ie. not in the range [-180, 180]).

{
"message": "Latitude must be within [-90, 90], Longitude must be within [-180, 180], Requires at least lat/lng pair, or geography_ids. None supplied.",
"code": "LocalLogic.API.BadRequest",
"statusCode": 422
}

500 - ServerError

This error code means that an error occurred on our end. Feel free to retry the same request to see if the problem persists. If you received a lot of these errors, please contact us at support@locallogic.co Example:

{
"code": "LocalLogic.API.ServerError",
"detail": "No Location Scores found for this location."
}

502 - BadGateway

This error code means that an error came from our cloud provider. Feel free to retry the same request to see if the problem persists. Example:

{
"message": "Internal server error"
}