Skip to content
Software capabilities

Google Drive capability

How to search Google Drive files

Search by name, type or other criteria in Drive. For a script, call files.list with a q expression and request the fields you need.

Documentation reviewed

Ways to do it

API

Drive API v3 files.list

Combine filters in q, such as a name prefix and trashed = false. Use fields to select the response data.

Requirements
An authorized Drive OAuth token and access to the target files.
Limitations
Without a trash filter the API returns trashed files too. Broad searches can report incompleteSearch, in which case narrow the corpus.

Example

GET https://www.googleapis.com/drive/v3/files?q=trashed%20%3D%20false%20and%20name%20contains%20%27Budget%27&fields=nextPageToken%2Cfiles%28id%2Cname%29
Read source: Drive files.list reference

Interface

Drive search bar and filters

Search Drive by name or content, then add filters such as Type or People to narrow the results.

Requirements
A signed-in Google account with access to the files.
Limitations
Search returns files available to the account you’re signed into. Files owned by the same organization may still be inaccessible to that account.
Read source: Google Drive search help