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.

To return place categories or icons in a preferred language, you use the language or icon parameters with either /categories or categories/{categoryId} requests.

The general steps are:

  1. Get the places service category URL.
  2. Set the parameter for the request:
    • filter (categories)
    • categoryId (categories/categoryId)
    • language (categories and categories/categoriesId)
    • icon (categories and categories/Id)
  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

Get categories in a preffered language

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

Return place icons

Use dark colors for code blocksCopy
1
https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/categories?icon=<ICON_FORMAT>&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.

example icon

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 but can be scaled smoothly for display in larger UI elements or to emphasize these features on a map. 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, 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 codes:

  • 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, created from an ArcGIS Location Platform account, 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { getCategories,searchCategories,getCategory } from "@esri/arcgis-rest-places";

const apiKey = "YOUR_ACCESS_TOKEN";

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { getCategories,searchCategories,getCategory } from "@esri/arcgis-rest-places";

const apiKey = "YOUR_ACCESS_TOKEN";

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'

Get place categories in Japanese

In this example, you use the language parameter to return all categories in Japanese. If no language is specifed, categories are returned in English.

Return the category name using its ID.

Steps

  1. Reference the places service.
  2. Set the language parameter to a preferred language.
  3. Set the token parameter to your access token.

APIs

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { getCategories,searchCategories,getCategory } from "@esri/arcgis-rest-places";

const apiKey = "YOUR_ACCESS_TOKEN";

const authentication = ApiKeyManager.fromKey(apiKey);


arcgisRest.request("https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/categories",{
    httpMethod: "GET",
    params: {
      token: authentication,
      language: "ja"
    }
  }).then((results)=>{
    console.log(results)
  });

REST API

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

Filter categories by language

In this example, you search for a category in French to return its full label and category ID.

Return the category in French.

Steps

  1. Reference the places service.
  2. Set the filter parameter to the category you want in the language.
  3. Set the language parameter to the preferred language.
  4. Set the token parameter to your access token.

APIs

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { getCategories,searchCategories,getCategory } from "@esri/arcgis-rest-places";

const apiKey = "YOUR_ACCESS_TOKEN";

const authentication = ApiKeyManager.fromKey(apiKey);


arcgisRest.request("https://places-api.arcgis.com/arcgis/rest/services/places-service/v1/categories",{
    httpMethod: "GET",
    params: {
      filter: "boulangerie",
      token: authentication,
      language: "fr"
    }
  }).then((results)=>{
    console.log(results)
  });

REST API

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

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