Find place categories

What is a place category?

A place category is a structure that represents a group of places that are related. Each category contains a categoryId, fullLabel, and parents (IDs). You use categories to help refine the results returned from nearby search and bounding box search.

There are four levels of place categories. The Level 1 category names and IDs include the following:

  • Arts and Entertainment:10000
  • Business and Professional Services:11000
  • Community and Government:12000
  • Dining and Drinking:13000
  • Events:14000
  • Health and Medicine:15000
  • Landmarks and Outdoors:16000
  • Retail:17000
  • Sports and Recreation:18000
  • Travel and Transportation:19000

How to find categories

To search for categories you use the places service /categories and /categories/{categoryId} requests. /categories returns all categories or filters categories that match a string, whereas /categories/{categoryId} returns the details for a specific category ID.

The general steps are:

  1. Get the places service category URL.
  2. Set the parameter for the request:
    • filter (categories)
    • categoryId (categories/categoryId)
  3. Execute the request.

URL requests

Get category details for a category ID.

Use dark colors for code blocksCopy
 
1
https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/categories/<CATEGORY_ID>&token=<ACCESS_TOKEN>&f=pjson

Find categories by filtering by a text string.

Use dark colors for code blocksCopy
 
1
https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/categories?filter=<TEXT>&token=<ACCESS_TOKEN>&f=pjson

Parameters

NameInTypeRequiredDefault valueDescription
query

string

A text filter that will be used for searching categories.

The text must be at least three characters and will be applied as a partial match. For example, using the filter "off" would return categories using the word "Office" as well as those using the word "Coffee".

query

string

json

The requested response format - either json or pjson (pretty json).

query

string

The authentication token with the premium:user:places privilege, used to access the Places service.

The token parameter can be either an API Key or short-lived token. See ArcGIS security documentation for more information on authenticating with a token or API key.

Alternatively, you can supply a token in the request header with one of the following keys using the "Bearer" scheme:

  • Authorization: Bearer <YOUR_TOKEN>
  • X-Esri-Authorization: Bearer <YOUR_TOKEN>

Code examples

Get all categories

In this example, you use the getCategories operation to return all parent and child categories. You should use this endpoint to fetch the latest set of categories.

  1. Reference the places service.
  2. Set the token parameter to your access token.
Get a list of all categories.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for Python
Use dark colors for code blocksCopy
                           
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { getCategories,searchCategories,getCategory } from "@esri/arcgis-rest-places";

const apiKey = "YOUR_API_KEY";

const authentication = ApiKeyManager.fromKey(apiKey);


getCategories({
  authentication
}).then((results)=>{
  console.log(JSON.stringify(results,null,2));
});

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
 
1
curl 'https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/categories?token=<ACCESS_TOKEN>&f=pjson'

Search for a category by ID

In this example, you search for a category using an ID. The categoryId is 13033, which is the ID for bubble tea shops. The parent categories are cafes, coffee, and tea houses. These fall within the broad category of Dining and Drinking.

Steps

  1. Reference the places service.
  2. Define a category ID.
  3. Set the token parameter to your access token.
Return the category name using its ID.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for Python
Use dark colors for code blocksCopy
                           
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { getCategories,searchCategories,getCategory } from "@esri/arcgis-rest-places";

const apiKey = "YOUR_API_KEY";

const authentication = ApiKeyManager.fromKey(apiKey);


getCategory({
  categoryId: "13033",
  authentication
}).then((results)=>{
  console.log(results.fullLabel);
});

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
 
1
curl 'https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/categories/13033?token=<ACCESS_TOKEN>&f=pjson'

Tutorials

Services

Places service (Beta)

Find and get details about businesses, places, and other POI.

API support

Category searchNearby searchBoundary searchPlace details
ArcGIS Maps SDK for JavaScript1
ArcGIS Maps SDK for .NET
ArcGIS Maps SDK for Kotlin
ArcGIS Maps SDK for Swift
ArcGIS Maps SDK for Java
ArcGIS Maps SDK for Qt
ArcGIS API for Python
ArcGIS REST JS
Esri Leaflet2222
MapLibre GL JS2222
OpenLayers2222
CesiumJS2222
Full supportPartial supportNo support
  • 1. Access via ArcGIS REST JS
  • 2. Access via ArcGIS REST JS.

Tools

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.