categorySet code

Hi, is there a document that list all of the category in the Search API with the corresponding code? (i.e. for the restaurant, it is 7315).

Also, do I have to put the code “7315” in the HTTP request, or I can also write “restaurant” as the categorySet?

Also, how many categories (both child and parent) can we put inside one HTTP request? In the example, I saw that we can put two childs of the category set (i.e. restaurant with child Italian or French).

Thank you for your help.

Best Regards,
Feb

Hi.
Here is the documentation:
POI Categories | Search API and Extended Search API Documentation, POI Categories | Search API And Extended Search API | TomTom Developer Portal
Try this:
https://api.tomtom.com/search/2/poiCategories.json?key=your-API-key

You can experiment with this using API Explorer:

For categorySet I see this description:
categorySet string (query)
A comma-separated list of categories which could be used to restrict the result to Points Of Interest of specific categories. The list of categories can be discovered using the POI Categories endpoint. Note: In the following “example:”, “7315” indicates a “restaurant”.

Experiments in API Explorer shows that for categorySet there have to be integer number id in it or list of id separated by comma, so “restaurant” doesn’t work, but “7315” works.

Hi,

I still don’t see the list of category Id from any of the link that you provided. The closest one is the POI Categories link, but even this one only provide some example that has Category ID for sports center and stadium. Not even restaurant (with the id 7315).

Thank you

Number of categories may be limited by technical reasons, but in practice (in typical usage) I don’t think you will see any.

About https://api.tomtom.com/search/2/poiCategories.json?key=your-API-key

Remember that instead of “your-API-key” you have to put your API key :slight_smile:

I actually do not have any problem calling the API. I just want to see the list of the categories Id. Like right now, I only know restaurant (which is 7315) from one of the example that I found. But I want to try calling like hotel (if there is any), but I do not know what the category Id for hotel. That’s why it would be helpful to have a list of the category Id with the corresponding result. So I can call the api.tomtom.com/search properly.

Thank you

You can reach the same using API Explorer

On the bottom of this page (in POI Categories section) you can click blue button GET and red button “TRY IT OUT”, fill two parameters and below it click EXECUTE. Below you will see result with all categories with restaurants (7315), hotels (7314) and other.

1 Like

Thank you Arkadiusz. I found the list of the categories.

Would you be able to help me answer another question?
I am trying to use the Point of Interest Details API, but I was not able to get any result.

I was able to get the result from Search API and Extended Search API with no problem at all. Then, I grabbed one of the POI id from my Search API result, and use it for the Point of Interest Details, but I got no result. The following is the response that I get when trying to open the URL link:
“This XML file does not appear to have any style information associated with it. The document tree is shown below.”

Can you help me on this?

Thank you

Hi

Did you read search-api/search-api-documentation/points-of-interest-details on developer portal?

Example POI id (below) from this documentation provides many information:
Rm91cnNxdWFyZTo1NTExYWY3MTQ5OGUwZjc4OWNkODRhZjI=

It would be helpful if you can show this POI id you have used, because maybe there is no such info for this particular one?

Hi,

These are some of the POI id that I am trying to use for the point of interest details:

  1. g6JpZK8zNjAwMDkwMDI5NjgxODehY6NJRE6hdqdVbmlmaWVk

  2. g6JpZK8zNjAwMDkwMDI0MDg1NzihY6NJRE6hdqdVbmlmaWVk

I also tried the POI id example that you provided above:
Rm91cnNxdWFyZTo1NTExYWY3MTQ5OGUwZjc4OWNkODRhZjI=

But it does not work. I used the following http for the POI details request:
https://api.tomtom.com/search/2/poiDetails.JSON?key=mykey&id=
I replaced the with the POI id. But does not work.

These two POI id you tried before (g6…) returns empty results, but the last one (Rm91…) works fine.
I think that may be a problem with link that you are using, because there is “poiDetails.JSON”, but it should be “poiDetails.json” (“json” with small letters).

Yes, you are right. Can you please tell me how were you able to get these POI id that works? The POI id example that you gave me works, and the two POI id that I provided returns blank value as you mentioned. Maybe I pulled the wrong POI id.

Which request did you use, and what is the name of JSON object that corresponds to the POI id?

Thank you very much for your help!

I’m using Search API Explorer, Fuzzy Search, GET, TRY IT OUT with query=hotel, EXECUTE.
In results there are POI ids and poiDetails id which are most interesting for you I think (with sign “=” at the end, but I don’t know if this is the rule) like this:

  "dataSources": {
    "poiDetails": [
      {
        "id": "Rm91cnNxdWFyZTo1ZDI1OThkYTcyMjZhNTAwMjM2ZWRlMmY=",
        "sourceName": "Foursquare"
      }
    ]
  }

Haha, yes I also noticed that your id has “equal” sign at the end, whereas mine has none (not sure if that causes an issue). But the way you get your POI id is the same as how I got mine. I used the Search API explorer, and use categoryId = 7315 (restaurant).
Maybe TomTom just doesn’t have details for the POI id of my place?

But I tested Foursquare API directly as well, and I was able to get more details in Foursquare directly.

Thank you so much for your help!

Do you know what is the difference between “tile” vs “non tile” request by any chance?

First impression it what result of request is expecting. If request is about part of the map that is tile request. Non tile request is about other things, like POI details.

That is what I was thinking as well. Thanks a lot Arkadiusz.

1 Like