Max number of results

Hello,

A quick question, what is the number of max results I can fetch per request from the API? I see that there is a maxresults query parameter, and its default value is 100. Is there a limit to how many results I can fetch, or is it capped at some value? Thank you!

Yours faithfully,
Iraklis Eleftheriadis

Hi, you can set MaxResults to any value but obviously if you set it very high with no parameters (e.g. without a geographic bounding box or search radius) you will attempt to download our entire dataset, which is currently just under 200K POIs and more than 180MB of download.

That’s OK if you just do it once a month or so but if you need to download the entire data set regularly there are probably better ways to do it and you should do everything you can to avoid slowing down the API for all of the other users.

1 Like

Thanks for the info! Now that you mention about slowing down the API, I noticed that some ItemURLs in the MediaItems category, load really slow. It does not have to do with my internet connection because I am able to load other urls quickly. Does it have to do with your server? Can anything be done to load them quicker?

The Media items have a set of URLs which represent the photo scaled to different resolutions. If you use the original .orig. it could be a very large file, if you use the thumbnail it may be too small for the display you are targeting, so if you replace .thmb. with .medi. in the URL you will get a medium scale image,

The actual server for the images is Amazon S3 and we can’t really make that faster. We may change to a different storage provider in the future.

1 Like

piggybacking on this, is there a reason why the api does not support pagination or sort parameters?
if we were able to paginate and sort the results by lastModifiedDate, that would be a huge DX improvement, Imo

@hanan thanks, the main reason is nobody has asked for pagination because they’re all doing spatial result sets, not pages of modifications since x and generally if you’re doing that sort of thing it’s for a data sync which could grab all data anyway (just use a high maxresults). It’s a good idea though, so PRs would be accepted - would need implemented for both the CacheProviderMongoDB and the SQL Server data store via POIManager.

There is a modifiedsince parameter you can use for date filtering and a sortby parameter which can be modified_asc, created_asc or id_asc - these were added for data sync purposes and I don’t think I added them to the official API docs