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

none

Determines whether icons are returned and the type of icon to use with a place or category.

Use this parameter to define the type of icon URL for a given place or category. Place icons are available in the following formats:

The SVG and CIM symbols default to 15 x 15 pixels when displayed on a map but can be scaled smoothly for display in larger UI elements. The PNG icons are provided as 48 x 48 pixels but for map display the recommended size is 16 x 16 pixels.

The default is none (no icon URL will be returned).

query

string

en

Optional case-sensitive parameter to specify the preferred language to use for category names.

This query parameter uses language codes to specify the preferred language. If not set, the or, if no translation is available, the default behavior is to return category names in English.

The language codes use the CLDR(Common Locale Data Repository) format string that uses a two letter language code (e.g. "fr" for French) optionally followed by a two letter country code (e.g. "fr-CA" for French in Canada).

If an unsupported language code is used, then the service will attempt to fall-back to the closest available language. This is done by stripping regional and extension subtags to find a known language code. For example, French Canadian (fr-CA) is unsupported so this falls back to French fr.

Should the fallback fail, then the service will return category names in the default language en for English.

| Language | Code | -------------------------- | ---- | English, default US | en | French | fr | German | de | Japanese | ja | Portuguese, default Brazil | pt | Spanish | es

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

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

API support

Category searchNearby searchBounding box 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.