Search query terms

This reference provides the query terms and operators you can use. To search for files, use the q parameter in files: list. To search for shared drives, use the q parameter in drives: list.

For file search examples, see Search for files and folders. For shared drive search examples, see Search for shared drives.

Query terms

When you create a file or shared drive search, you can provide query terms provided in the File query terms or Shared drive query terms tables.

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.

Query operators

This table provides query operator usage information.

Operator Usage
contains The content of one string is present in the other.
= The content of a string or boolean is equal to the other.
!= The content of a string or boolean is not equal to the other.
< A value is less than another.
<= A value is less than or equal to another.
> A value is greater than another.
>= A value is greater than or equal to another.
in An element is contained within a collection.
and Return items that match both queries.
or Return items that match either query.
not Negates a search query.
has A collection contains an element matching the parameters.

File query terms

This table provides usage tips for query terms. For data types and descriptions, see files resource reference.

Term Valid operators Usage
title contains1, =, != Name of the file. Surround with single quotes '. Escape single quotes in queries with \', e.g., 'Valentine\'s Day'.
fullText contains2 Full text of the file including title, 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'.
modifiedDate <=, <, =, !=, >, >= 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.
lastViewedByMeDate <=, <, =, !=, >, >= 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.
trashed =, != Whether the file is in the trash or not. Can be either true or false.
starred =, != Whether the file is starred or not. Can be either true or false.
parents in Whether the parents collection contains the specified ID.
owners3 in Users who own the file.
writers3 in Users or groups who have permission to modify the file. See Permissions resource reference.
readers3 in 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.
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'.

Shared drive query terms

This table provides usage tips for query terms. For data types and descriptions, see drives resource reference.

Term Valid Operators Usage
createdDate4 <=, <, =, !=, >, >= Date when the shared drive was created. Use RFC 3339 format, default timezone is UTC, e.g., 2012-06-04T12:00:00-08:00.
hidden5 =, != Specifies whether or not the shared drive is hidden. Can be either true or false.
memberCount4 <=, <, =, !=, >, >= Number of users and groups that are members of the shared drive. Takes a numerical value.
name4 contains, =, != Name of the shared drive. Surround with single quotes '. Escape single quotes in queries with \', e.g., 'Valentine\'s Day'.
organizerCount4 <=, <, =, !=, >, >= Number of users and groups that are organizers of the shared drive. Takes a numerical value.