Search - Get Search POI Category Tree Preview

Get POI Category Tree

Applies to: S0 and S1 pricing tiers.

POI Category API provides a full list of supported Points of Interest (POI) categories and subcategories together with their translations and synonyms. The returned content can be used to provide more meaningful results through other Search Service APIs, like Get Search POI.

GET https://atlas.microsoft.com/search/poi/category/tree/json?api-version=1.0
GET https://atlas.microsoft.com/search/poi/category/tree/json?subscription-key={subscription-key}&api-version=1.0&language={language}

URI Parameters

Name In Required Type Description
format
path True

Desired format of the response. Only json format is supported.

api-version
query True
  • string

Version number of Azure Maps API. Current version is 1.0

language
query
  • string

Language in which search results should be returned. Should be one of supported IETF language tags, except NGT and NGT-Latn. Language tag is case insensitive. When data in specified language is not available for a specific field, default language is used (English).

Please refer to Supported Languages for details.

subscription-key
query
  • string

One of the Azure Maps keys provided from an Azure Map Account. Please refer to this article for details on how to manage authentication.

Request Header

Name Required Type Description
x-ms-client-id
  • string

Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following articles for guidance.

Responses

Name Type Description
200 OK

OK

Media Types: "application/json", "application/xml"

400 Bad Request

Bad request: one or more parameters were incorrectly specified or are mutually exclusive.

Media Types: "application/json", "application/xml"

401 Unauthorized

Access denied due to invalid subscription key or invalid Azure Active Directory bearer token. Make sure to provide a valid key for an active Azure subscription and Maps resource. Otherwise, verify the WWW-Authenticate header for error code and description of the provided AAD bearer token.

Media Types: "application/json", "application/xml"

Headers

  • WWW-Authenticate: string
403 Forbidden

Permission, capacity, or authentication issues.

Media Types: "application/json", "application/xml"

404 Not Found

Not Found: the requested resource could not be found, but it may be available again in the future.

Media Types: "application/json", "application/xml"

500 Internal Server Error

An error occurred while processing the request. Please try again later.

Media Types: "application/json", "application/xml"

Security

azure_auth

These are the Azure Active Directory OAuth2 Flows. When paired with Azure Role Based Access control it can be used to control access to Azure Maps REST APIs. Azure Role based access controls are used to designate access to one or more Azure Maps resource account or sub-resources. Any user, group, or service principal can be granted access via a built in role or a custom role composed of one or more permissions to Azure Maps REST APIs.

To implement scenarios we recommend viewing authentication concepts. In summary, this security definition provides a solution for modeling application(s) via objects capable of access control on specific APIs and scopes.

Note

  • This security definition requires the use of the x-ms-client-id header to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the Maps management API.
  • The Authorization URL is specific to the Azure public cloud instance. Sovereign clouds have unique Authorization URLs and Azure Active directory configurations.
  • The Azure role based access control is configured from the Azure management plane via Azure portal, Powershell, CLI, Azure SDKs, or REST APIs.
  • Usage of the Azure Maps Web SDK allows for configuration based setup of an application for multiple use cases.
  • Currently Azure Active Directory v1.0 tokens are supported.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

subscription-key

This is a shared key which is provisioned when creating an Azure Maps resource through the Azure management plane via Azure portal, Powershell, CLI, Azure SDKs, or REST APIs. With this key, any application is authorized to access all REST APIs. In other words, these can currently be treated as master keys to the account which they are issued for. For publicly exposed applications our recommendation is to use server to server access of Azure Maps REST APIs where this key can be securely stored.

Type: apiKey
In: query

Examples

Get the POI Category Tree (only partial response shown below)

Sample Request

GET https://atlas.microsoft.com/search/poi/category/tree/json?subscription-key=[subscription-key]&api-version=1.0

Sample Response

{
  "poiCategories": [
    {
      "id": 7320,
      "name": "Sports Center",
      "childCategoryIds": [
        7320002,
        7320003,
        7320005
      ],
      "synonyms": [
        "Gym",
        "Indoors Sports",
        "Sports Centre"
      ]
    },
    {
      "id": 7374,
      "name": "Stadium",
      "childCategoryIds": [
        7374002,
        7374009,
        7374012,
        7374003,
        7374010,
        7374005,
        7374008,
        7374011,
        7374006,
        7374014,
        7374013,
        7374007,
        7374004
      ],
      "synonyms": [
        "Arena",
        "Gymnasium",
        "Sports Ground",
        "Sports Stadium"
      ]
    },
    {
      "id": 7315,
      "name": "Restaurant",
      "childCategoryIds": [
        7315081,
        7315002,
        7315082,
        7315003,
        7315083,
        7315084,
        7315085,
        7315062,
        7315086,
        7315004,
        7315146,
        7315005,
        7315087,
        7315006,
        7315007,
        7315088,
        7315089,
        7315072,
        7315008,
        7315142,
        7315090,
        7315091,
        7315147,
        7315009,
        7315092,
        7315010,
        7315011,
        7315070,
        7315093,
        7315012,
        7315094,
        7315095,
        7315063,
        7315013,
        7315096,
        7315097,
        7315068,
        7315098,
        7315099,
        7315057,
        7315079,
        7315014,
        7315100,
        7315101,
        7315132,
        7315102,
        7315133,
        7315015,
        7315016,
        7315104,
        7315134,
        7315017,
        7315071,
        7315018,
        7315019,
        7315020,
        7315054,
        7315069,
        7315021,
        7315058,
        7315052,
        7315022,
        7315078,
        7315023,
        7315024,
        7315073,
        7315105,
        7315065,
        7315106,
        7315025,
        7315066,
        7315026,
        7315027,
        7315028,
        7315067,
        7315029,
        7315030,
        7315107,
        7315135,
        7315108,
        7315031,
        7315109,
        7315032,
        7315033,
        7315034,
        7315110,
        7315074,
        7315136,
        7315111,
        7315112,
        7315075,
        7315035,
        7315127,
        7315061,
        7315036,
        7315037,
        7315129,
        7315038,
        7315130,
        7315039,
        7315041,
        7315131,
        7315040,
        7315143,
        7315042,
        7315113,
        7315114,
        7315115,
        7315043,
        7315053,
        7315055,
        7315056,
        7315116,
        7315117,
        7315080,
        7315139,
        7315064,
        7315140,
        7315044,
        7315045,
        7315118,
        7315046,
        7315148,
        7315119,
        7315047,
        7315120,
        7315059,
        7315145,
        7315076,
        7315121,
        7315048,
        7315122,
        7315123,
        7315049,
        7315124,
        7315050,
        7315125,
        7315051,
        7315126,
        7315060,
        7315149
      ],
      "synonyms": [
        "Dining",
        "Eatery",
        "Eating House",
        "Eating Place"
      ]
    }
  ]
}
{
  "error": {
    "code": "400 BadRequest",
    "message": "Bad request: one or more parameters were incorrectly specified or are mutually exclusive."
  }
}
{
  "error": {
    "code": "401 Unauthorized",
    "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
  }
}
{
  "error": {
    "code": "403 Forbidden",
    "message": "Permission, capacity, or authentication issues."
  }
}
{
  "error": {
    "code": "404 NotFound",
    "message": "Not Found: the requested resource could not be found, but it may be available again in the future."
  }
}
{
  "error": {
    "code": "500 InternalServerError",
    "message": "An error occurred while processing the request. Please try again later."
  }
}

Definitions

JsonFormat

Desired format of the response. Only json format is supported.

ODataError

This object is returned when an error occurs in the Maps API.

ODataErrorResponse

This response object is returned when an error occurs in the Maps API.

PoiCategoryResponse

This object is returned from a successful POI Category Tree call

PoiCategoryResult

POI category result

JsonFormat

Desired format of the response. Only json format is supported.

Name Type Description
json
  • string

The JavaScript Object Notation Data Interchange Format

ODataError

This object is returned when an error occurs in the Maps API.

Name Type Description
code
  • string

The ODataError code.

details

This object is returned when an error occurs in the Maps API.

message
  • string

If available, a human readable description of the error.

target
  • string

If available, the target causing the error.

ODataErrorResponse

This response object is returned when an error occurs in the Maps API.

Name Type Description
error

This object is returned when an error occurs in the Maps API.

PoiCategoryResponse

This object is returned from a successful POI Category Tree call

Name Type Description
poiCategories

Categories array

PoiCategoryResult

POI category result

Name Type Description
childCategoryIds
  • integer[]

Array of child category ids

id
  • integer

Unique ID for the category. ID can be used to restrict search results to specific categories through other Search Service APIs, like Get Search POI.

name
  • string

Name of the category

synonyms
  • string[]

Array of alternative names of the category