The general steps to find places with the places service are to:
1. Select a category
To start searching for places, you should identify one or more place categories for the types of places you are interested in. Categories are used to help filter search results so only the type of places you are interested in are returned. All categories have a name and a unique ID. To help find the appropriate category (and ID), you can use the /categories
request or the places category finder tool.
https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/categories?filter=grocery&token=<ACCESS_TOKEN>&f=pjson
{
"categories": [
{
"categoryId": "17069",
"fullLabel": [
"Retail",
"Food and Beverage Retail",
"Grocery Store / Supermarket"
],
"parents": [
"17000",
"17057"
]
},
2. Search for places
To search for places you can use the /places/near-point
or /places/within-extent
request. To filter and return the best results, you should provide a list of categories and/or keywords when you search. When places are returned, they contain attributes such as name
, place
, location
, and categories
. You can use the place attributes to display them on a map or to get more details about each place.
Nearby search
https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/places/near-point?x=-3.1883&y=55.9533&radius=500&categoryIds=17069&pageSize=1&token=<ACCESS_TOKEN>&f=pjson
Bounding box search
https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/places/within-extent?xmin=-3.1951975822448735&ymin=55.95079788951077&xmax=-3.180649280548096&ymax=55.95603574810763&categoryIds=17069&pageSize=1&token=<ACCESS_TOKEN>&f=pjson
{
"results": [
{
"placeId": "5bbf7493cc5ed5a7f0b8ac78220aa301",
"location": {
"x": -3.191426,
"y": 55.952693
},
"categories": [
{
"categoryId": "17069",
"label": "Grocery Store / Supermarket"
},
{
"categoryId": "17071",
"label": "Health Food Store"
}
],
"name": "The Refillery",
"distance": 206.0
}
}
3. Get place information
After you perform a place search, you can use /places/{place
to request additional attributes for each place. To do so, you use a place ID and set the requested
parameter to specify the fields you want. The request fields are grouped into Place, Address, and/or Details price groups. The number of attributes returned can vary depending on the type of place.
https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/places/5bbf7493cc5ed5a7f0b8ac78220aa301?requestedFields=all&token=<ACCESS_TOKEN>&f=pjson
{
"placeDetails": {
"placeId": "5bbf7493cc5ed5a7f0b8ac78220aa301",
"categories": [
{
"categoryId": "17069",
"label": "Grocery Store / Supermarket"
},
{
"categoryId": "17071",
"label": "Health Food Store"
}
],
"name": "The Refillery",
"description": null,
"address": {
"streetAddress": null,
"extended": null,
"locality": "Edinburgh",
"designatedMarketArea": null,
"region": "Lothian",
"postcode": "EH1 1BQ",
"poBox": null,
"country": "GB",
"adminRegion": "Scotland",
"postTown": "Edinburgh",
"neighborhood": [
],
"censusBlockId": null
},
Tutorials
Find nearby places and details
Find points of interest near a location and get detailed information about them
Find places in a bounding box
Perform a text-based search to find places within a bounding box.
Services
Places service
Find and get details about businesses, places, and other POI.
API support
- 1. Access via ArcGIS REST JS
- 2. Access via ArcGIS REST JS.