How to see childCategoryIds of different categories?

Margot 0 Reputation points
2024-06-12T13:55:41.29+00:00

Hi everyone,

I am trying to do a point of interest search based on particular categories. What I am not understanding is how to access the childCategoryIds so that I can narrow down my search to be more precise. When doing a category tree search as outlined in https://learn.microsoft.com/en-us/rest/api/maps/search/get-search-poi-category-tree?view=rest-maps-1.0&tabs=HTTP I get the main category along with the childCategoryId codes but not what those child categoryId's codes correspond to. Would love to hear how people got access to these or resolved the issue so that they could narrow down their POI category searches.

Thanks!

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
664 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 16,551 Reputation points Microsoft Employee
    2024-06-12T16:23:23.1066667+00:00

    All that information is in the category tree service response. If you look closely at the response, you will find that at the beginning, there are top level categories like "Restaurant" which has a bunch of child category ids, but if you go past the middle of the list, you find that you get the child categories, and they don't have any children under them. Looking at the list there appears to be 105 top level categories and 502 child categories (based on the length of the ID. I assumed the 4-digit IDs were top level, and the 7-digit IDs are child level).

    I've taken the response and broke it up into some tables in Excel (you can access it from my OneDrive here as it won't let me attach it in the forums). Note that the purpose of having an API is that categories may change over time. That said, I don't think they will change that often, so you likely don't want/need to call this constantly.

    0 comments No comments