
Multiple corpora may be searched in a single query, though To search other corpora, such as files shared to a For example, to search for a customįile property called additionalID with a value of 8e8aceg2af2ge72e78: appProperties has įor further information on custom file properties, seeĪdd custom file properties. To search for files with a custom file property, use the appProperties search Search for files with a custom file property ModifiedTime > 'T12:00:00' and (mimeType contains 'image/' or mimeType contains 'video/') Image or video files modified after a specific date ModifiedTime > 'T12:00:00' // default time zone is UTCįiles shared with the authorized user with "hello" in the nameįiles that have not been shared with anyone or domains (only private, or shared with specific users or groups) parents collectionįiles in an Application data folder in a collectionįiles for which user has write in writersįiles for which members of the group have write in writers MimeType != 'application/'įiles that contain the text "important" and in the trashįullText contains 'important' and trashed = trueįiles that contain the exact phrase "hello world"įiles with a query that contains the "\" character (e.g., "\authors")įiles with ID within a collection, e.g. Name contains 'hello' and name contains 'goodbye'įiles with a name that does not contain the word "hello"įolders that are Google apps or have the folder MIME type What you want to queryįiles with a name containing the words "hello" and "goodbye" Client libraries handle this encoding automatically. Note: These examples use the unencoded q parameter, where name = 'hello' is encoded as The client library you use for your search. This table shows some basic query strings. Q: mimeType = 'application/' Query string examples To restrict the search to folders, use the query string to set the MIME type to Page_token = response.get('nextPageToken', None)įields: 'nextPageToken, files(id, name)',Ĭonsole.log('Found file: ', file.name, file.id) Response = drive_service.files().list(q="mimeType='image/jpeg'", setFields("nextPageToken, files(id, name)") ThisĮxample also sets spaces to drive to further narrow the search to theįileList result = driveService.files().list()

MimeType query term to narrow results to files of type image/jpeg. Results to file names and IDs of JPEG image files.
#Google search for specific file type how to#
The following example shows how to use a client library to filter search values are the specific values you want to use to filter your searchįor example, the following query string filters the search to just returnįolders: q: mimeType = 'application/'.You can use with each query term, refer to operator specifies the condition for the query term.

Query terms that can be used to filter shared drives, refer to

Use the files.list without any parameters Search for all files and folders on the current user's My Drive
