13

I just wanted clarification with regard to the Files: list feature of the Google Drive API here:

https://developers.google.com/drive/v2/reference/files/list

What is the the maximum value that can be specified with maxResults? I assume this value calculates the number of results on the next page of results?

Also, is the nextPageToken simply part of the query string that's required to be passed with nextLink to get the next page of results?

Thanks!

Mohammed H
  • 6,880
  • 16
  • 81
  • 127
Stuart Memo
  • 1,138
  • 4
  • 14
  • 30

2 Answers2

16

The maxResults query parameter can be used to limit (or increase) the number of items returned in a list request. There is a default value and a hard limit that is set by our server. Unfortunately, we don't usually document those numbers as they can easily change and recommend developers to look for a nextPageToken and/or nextLink in the resulting collection to know whether or not all items have been returned.

The nextPageToken attribute is to be used as the pageToken query parameter on a list request. If you are using the nextLink from the resulting collection, you do not need to specify the pageToken query parameter as it should already be included.

Alain
  • 6,044
  • 21
  • 27
  • So if there are 100 files in the Drive and I set maxResults to 10, will I still be able to list all files, in 10 consecutive requests? – Roman Plášil Dec 07 '12 at 00:20
  • can you tell us a ballpark for the hard limit on maxResults? is it above 500 or so at least? – Mohamed Hafez Dec 13 '13 at 17:49
  • Great comment. Do we know if any `pageToken`'s are bypassed when using `nextLink`? – Alex Legg Mar 23 '16 at 13:59
  • how can I get the records more than 1000 - pls refer my question in this link - http://stackoverflow.com/questions/41572228/how-to-list-of-more-than-1000-records-from-google-drive-api-v3-in-c-sharp – Arun Jan 10 '17 at 16:12
3

maxResults cannot be larger than 1000 according to this page: https://developers.google.com/drive/v2/reference/files/list

lindenrovio
  • 357
  • 3
  • 13