Google Photos API, pageSize Parameter not returning expected results
Asked Answered
D

1

6

Using the Google Photos API Explorer I am trying to limit the number of albums returned using the albums.list method.

If I set pageSize = 10, the api explorer returns 5 albums, if I set it to 3 in returns 1 album.

Any suggestions as to why I am not seeing the same number of albums in the response as is set via the pageSize parameter?

Thanks

Devoir answered 22/6, 2018 at 9:29 Comment(0)
R
4

The page size describes the desired maximum number of results, but it is no guarantee.

If you need at least 10 results from a single request, your best option would be to request a higher page size as you have found. Alternatively, you can always make additional requests using the nextPageToken.

(We have some plans to improve this in the future and return a number of results that's equal, or even closer, to the page size. Unfortunately, at the moment we can't guarantee the number of results in a request, but we always try to fill a page size if possible.)

Richly answered 11/7, 2018 at 4:5 Comment(1)
It would be good to mention about this behavior in the documentation :)Setsukosett

© 2022 - 2024 — McMap. All rights reserved.