getCategories

getCategories

Function
getCategories(requestOptionsIGetCategoriesOptions): Promise<IGetCategoriesResponse>

The ArcGIS Places service has many categories (or types) of place, from art museums to zoos. This endpoint returns all the categories including their label and categoryId. The category Id can be used to search for types of places with a places/near-point or places/within-extentrequest.

Categories also have information on their parent. This allows you to search for specific categories such as "French Restaurant" - or to look for more generic types such as "Restaurant".

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
import { getCategories } from "@esri/arcgis-rest-places";
import { ApiKeyManager } from "@esri/arcgis-rest-request";

const response = await getCategories({
  authentication: ApiKeyManager.fromKey("YOUR_API_KEY")
});

console.log(response.categories);
Parameters
ParameterType
requestOptions
IGetCategoriesOptions
Returns 
Promise<IGetCategoriesResponse>

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