getCategories
FunctiongetCategories(requestOptions: IGetCategoriesOptions): 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-extent
request.
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".
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
Parameter | Type |
---|---|
request | IGetCategoriesOptions |
Returns
Promise<IGetCategoriesResponse>