Query terms

You can use query operators, which provide the condition for the query term that you want to return. You can use multiple query operators to further filter the query results with the conjunctions and or or, and negate the query with not.

Full text of the file including name, description, content, and indexable text. Surround with single quotes '. Escape single quotes in queries with \', e.g., 'Valentine\'s Day'.

mimeType

contains, =, !=

MIME type of the file. Surround with single quotes '. Escape single quotes in queries with \', e.g., 'Valentine\'s Day'.

modifiedTime

<=, <, =, !=, >, >=

Date of the last modification of the file. RFC 3339 format, default timezone is UTC, e.g., 2012-06-04T12:00:00-08:00. Fields of type date are not currently comparable to each other, only to constant dates.

viewedByMeTime

<=, <, =, !=, >, >=

Date that the user last viewed a file. RFC 3339 format, default timezone is UTC, e.g., 2012-06-04T12:00:00-08:00. Fields of type date are not currently comparable to each other, only to constant dates.

Users or groups who have permission to read the file. See Permissions resource reference.

sharedWithMe

=, !=

Files that are in the user's "Shared with me" collection. All file users are in the file's access control list (ACL). Can be either true or false.

properties

has

Public custom file properties.

appProperties

has

Private custom file properties.

visibility

=, '!='

The visibility level of the file. Valid values are anyoneCanFind, anyoneWithLink, domainCanFind, domainWithLink, and limited. Surround with single quotes '. Escape single quotes in queries with \', e.g., 'Valentine\'s Day'.

[1] The contains operator only performs prefix matching for a name.
For example, the name "HelloWorld" would match for name contains 'Hello' but not
name contains 'World'.[2] The contains operator only performs matching on entire string tokens for fullText.
For example, if the full text of a doc contains the string "HelloWorld" only the query fullText contains 'HelloWorld' returns a result.
Queries such as fullText contains 'Hello' do not return results in this scenario.[2] The contains operator matches on an exact alphanumeric phrase if it is surrounded by double quotes. For example, if the fullText of a doc contains the string "Hello there world", then the query fullText contains '"Hello there"' will return a result, but the query fullText contains '"Hello world"' will not. Furthermore, since the search is alphanumeric, if the fullText of a doc contains the string "Hello_world", then the query fullText contains '"Hello world"' will return a result.
[3] The owners, writers and readers properties are indirectly reflected in the [Permissions](/drive/api/v3/reference/permissions) list and refer to the role on the permission.