Google Drive API with Claude: Find Every File, Skip the Traps
The Drive API has no folder paths, hides shared drives by default, and gives Google Sheets no downloadable bytes. The video covers the three habits that make every call complete, page after page.
It is easy to assume that Claude can find a file in Google Drive by its folder path, the way it would on an ordinary file system. The video explains why that assumption fails and what to do instead. Drive works entirely by file ID, and three specific habits decide whether a search comes back complete or silently wrong.
There is no path API
The video begins with the mistaken belief that Claude locates a Drive file by walking a folder path. There is no path API. Drive is organized entirely around file IDs, so any approach built on paths will not work. The rest of the video looks at what the ID-based model actually requires.
A folder is just a file with a mimeType
In Google Drive, a folder is not a separate kind of object. It is a file whose mimeType says it is a folder. As a result, there is no get-folder endpoint to call when you want a folder's contents. Instead, Claude searches for every file whose parents array contains that folder's ID. This is the first habit: treat a folder as a file.
Shared drives are invisible by default
The video's central example is a request for every spreadsheet modified in the last month on a team's shared drive, exported as CSV. Files on a shared drive are invisible by default, and the search needs three extra parameters just to see them. Once the list comes back, the fields parameter must explicitly ask for nextPageToken, or the results quietly stop after one page. This gives the second habit: add the shared-drive parameters, including supportsAllDrives, for anything shared, and ask for the page token.
Complete, or silently wrong
With the shared-drive parameters correct and the page token requested, the list comes back complete, page after page. A further trap remains. A Google Sheet has no downloadable bytes, because it is a Google-native document and not a binary file. Fetching it with alt=media returns a flat 403 rather than a helpful message. The fix is the export endpoint. That is the third habit: export instead of download for anything Google made.
The video stresses that skipping any one of these habits produces a failure that never names the missing parameter. A missing supportsAllDrives, for example, just looks as though the file was never there.
Carry-out
Every Drive call Claude makes turns on the same three habits: treat a folder as a file, add supportsAllDrives for anything shared, and export rather than download for anything Google made. The video also notes that it is not claiming these are the only rules that matter, only the three that govern every call.
Key takeaways
- Google Drive has no path API; everything works by file ID.
- A folder is a file with a folder mimeType, so listing contents means searching by parent ID.
- Files on shared drives are invisible unless the search includes the extra shared-drive parameters.
- The fields parameter must ask for nextPageToken, or results stop at one page.
- Google Sheets have no downloadable bytes, so alt=media returns a 403.
- Use the export endpoint to get a Sheet as CSV.
- A missed parameter fails silently, so it can look like the file never existed.
Try it yourself
Give Claude this prompt: "Find all spreadsheets modified in the last 30 days on our shared drive, and export the first one as CSV." Then watch for three things. Does it pass all three shared-drive parameters on the search? Does it ask for nextPageToken in the fields parameter? And does it use the export endpoint for the sheet instead of trying alt=media?
Chapters
Full transcript(auto-generated, with timestamps)
Claude finds my file by its folder path in Drive. Right?
[0:00]Someone assumes Claude finds a drive file by its folder path like a normal file system. There's no path API. Drive works entirely by file ID. So, what does that ID-based model actually get you? In
Not a separate thing — a file with a mimeType
[0:12]Google Drive, a folder isn't a separate kind of thing from a file. It's a file with a mime type that says folder. Ask Claude to list a folder's contents and there's no get folder endpoint to call. It searches for every file whose parents array contains that folder's ID. Say you
THE ANCHOR — shared drive, invisible by default
[0:27]Want every spreadsheet modified in the last month on your team's shared drive exported as CSV. Files there are invisible by default. The search needs three extra parameters just to see them. And once the list comes back, fields equals has to explicitly ask for next page token or the results quietly stop at one page. Get all three shared drive
Complete — or silently wrong
[0:46]Parameters right, ask for next page token, and the list comes back complete page after page. But that spreadsheet has no downloadable bytes. It's a Google Sheet, not a binary file. So, pulling it with all equals media returns a flat 403, not a helpful error. The fix is the export endpoint instead. Skip any one of these three habits and the failure never says which parameter you missed. A missing supports all drives just looks like the file was never there. Every Google Drive call Claude makes
Carry-out
[1:13]Turns on three habits: treat a folder as a file, add supports all drives for anything shared, and export instead of download for anything Google made. Your turn. Here's the prompt. Read it with
Your turn
[1:24]Me. Find all spreadsheets modified in the last 30 days on our shared drive and export the first one as CSV. Watch three things. Does it pass all three shared drive parameters on the search? Does it ask for next page token in fields equals? And does it export the sheet instead of trying all equals media? Liam in for Bear. Claude Google Drive API.
Outro
[1:43]Liam in for Bear.
More from Claude
2:49Claude Meets an API It's Never Seen: The Grafana API Skill
2:19Enterprise Search for Claude: Snippets Aren't Answers
3:10Can Claude Make a Good Chart? Only With a Charting Kit
1:40Debug Plugins: Your Claude Plugin Is Stale, Not Broken
2:30HubSpot API: Ask for Every Field, or You Get Almost None
2:15