Drive API v3 only retrieves 460 files despite setting pageSize to 1000

I’m working with the Google Drive v3 REST API using libcurl in my C application. I’m trying to fetch all files from a specific folder that contains over 3000 files.

Here’s the API endpoint I’m calling:

https://www.googleapis.com/drive/v3/files?fields=nextPageToken,files(id,name,createdTime,modifiedTime,webViewLink,mimeType,fileExtension,size,hasThumbnail,thumbnailLink,trashed,shared,parents,md5Checksum,ownedByMe,version,starred,kind,owners(emailAddress))&pageSize=1000&pageToken=TOKEN_VALUE&q=parents=FOLDER_ID

The problem is that even though I set pageSize to 1000, the API consistently returns only 460 records per request. This means I need way more iterations to get all my files than expected.

Does Google have some hidden limit on the actual page size that overrides the requested pageSize parameter? How can I get closer to the 1000 files per request that I’m asking for?

Google Drive API throttles based on request complexity, not just pageSize. That massive fields list you’re using hits Google’s resource limits - that’s why you’re stuck at ~460 files instead of your 1000 pageSize setting. I ran into this exact issue during an enterprise migration. Google calculates response size using field complexity and server load, so your pageSize doesn’t matter much. Try a two-stage approach: grab basic metadata with minimal fields first, then make targeted requests for detailed info only when you actually need it. This approach boosted my throughput and cut API quota usage significantly.

Had the same issue building a Google Drive backup app. The Drive API limits how many files it returns, especially in folders with mixed file types. I noticed that requesting too many fields at once really cuts down the count. My fix was simple - only query essential fields like id and name first, then grab other details in separate calls. This boosted items per request and made the whole app way more efficient.

yeah, that’s a known google drive api quirk. google won’t actually return the full 1000 pagesize when you request too many fields at once. cut down your fields parameter - drop expensive stuff like thumbnailLink and owners info. i stick to basic fields and get way better results, sometimes 800+ files per page instead of that 460 you’re hitting.