Search API, can't get all results in response

Hi, I have some problem. First, I sent this GET request(with my key).

https://api.tomtom.com/search/2/search/petrol%20station.json?key=&countrySet=UA

Result of request was “numResults”:10,“totalResults”:6091. In response I have 10 results, but my task is to parse all results and get some information. I try to use limit and offset. Default value for limit is 10, max = 100. Default value of offset is 0, max = 1800. So, I try to get all results, but the best case was 1900 results from 6091. Help me please, I cannot find answer.

It is not a typical use case for this service…
Best results you can get when you get bounding box of an area, then try to slice it to smaller pieces and search within this pieces.

2 Likes

Thanks, you confirmed my guesses.

Hi,
Is there a problem with POI search by category? I can not get any results even if I use your example at the api page.
Regards,
Omar

Can you give the query you are using?

Hi,
I am even trying the query on your page
https://api.tomtom.com/search/2/nearbySearch/.json?lat=37.337&lon=-121.89&countrySet=FR&radius=5000&idxSet=POI&categorySet=7315&brandSet=TomTom&connectorSet=IEC62196Type2CableAttached&key=*****

But in returns no results

I would like to search within radius, and get by category. can you give me sample query please

OK, the example query needs to be updated. Too many parameters are defined that are excluding each other.
Try with this:
https://api.tomtom.com/search/2/nearbySearch/.json?lat=37.337&lon=-121.89&radius=5000&categorySet=7315&key=*****

1 Like

Hi Dima,
The “numResults” and “totalResults” fields that you get in response are a subject of current works. You can expect an improvement and therefore more stability soon.
Be also aware that it is always best to limit your requests with radius or boundig box, as those scenarios usually make more sense and may improve the performance.

Regards,
Rafał

Hi guys!

Just wanted to find all parks in my area and tried to send requests like this one

https://api.tomtom.com/search/2/categorySearch/park.json?limit=100&topLeft=54.844%2C%20-112.017&btmRight=54.823%2C%20-111.934&key

I checked and in this area, there should be " Sir Winston Churchill Provincial Park" but I did not receive this park in response. I also tried other requests - with radius, etc. But in the end, not all parks come in response.

Why is that so?