question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v3] gdrive.files.list doesnt allow pageSize > 100

See original GitHub issue
> gdrive.files.list({
        auth: client,
        userId: accountId,
        pageToken: nextPageToken,
        pageSize: 200, // tried 1000 as well as the documentation says pageSize can be within range of [1,1000]
        // orderBy: 'modifiedTime', // tried this option as well to see if it helped... it didnt
      }, function (err, result) {
        console.log(result.files.length)
})

100

my account has thousands of files, i actually had this function in a recursive function where if there was a nextPageToken i would call gdrive.files.list again. every time it would only return between [0, 100].

here is a reference to the gdrive v3 api https://developers.google.com/drive/v3/reference/files/list pageSize integer The maximum number of files to return per page. Acceptable values are 1 to 1000, inclusive. (Default: 100)

is there some hidden condition to be able to get more than 100 files in a single api call?

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
leanderleecommented, Dec 24, 2017

Apparently this only happens if files(permissions) is added to the field string.

0reactions
awalmubarakcommented, Aug 21, 2020

I had the same problem and solved it by adding maxResults:1000

so in the end i had pageSize:1000, maxResults:1000

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google drive API files list size <= 100 when specify fields ...
This is normal due to the limit of characters. The limit is dependent on both the server and the client used so when...
Read more >
Files: list | Google Drive
The list of files. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched....
Read more >
Search files with Google Drive api v3 - Daimto
The Google Drive API v3 file.list method has a parameter called Q which will allow us to search for files within a users...
Read more >
Display the first 100 files & folders in your Google Drive
Ability to create source files with either a code editor or shell commands. Basic skills in Python (2 or 3), but you can...
Read more >
Upload and Download files from Google Drive storage using ...
It is a REST API that allows you to leverage Google Drive storage from within your app or program. So, let's go ahead...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found