Search for shared drives

To search for a specific set of shared drives, use the query stringq fieldwithdrives.list to filter the drives toreturn by combining one or more search terms.

A query string contains the following three parts:

query_term operator values

Where:

To view the query terms and operators that you can use to filter shared drives,seeSearch query terms and operators.

For example, the following query string filters the search to only return shareddrives with the name "Google Drive API resources."

q: name = 'Google Drive API resources' & useDomainAdminAccess=false

Query string examples

The following table lists examples of some basic query strings for shareddrives. The actual code differs depending on the client library you use for yoursearch.

You must also escape special characters in your file names to make sure thequery works correctly. For example, if a filename contains both an apostrophe(') and a backslash ("\") character, use a backslash to escape them:namecontains 'quinn\'s paper\\essay'.

Note: These examples show the unencodedq parameter, whereorganizerCount =0 is encoded asorganizerCount+%3d+0. Client libraries handle this encodingautomatically.
What you want to queryExampleuseDomainAdminAccess setting
Shared drives created after June 1, 2017createdTime > '2017-06-01T12:00:00'true
Shared drives visible in the default viewhidden = falsefalse
Shared drives with more than one membermemberCount > 1true
Shared drives with the word 'confidential' in the title and 20 or more membersname contains 'confidential' and memberCount >= 20true
Shared drives with the word 'confidential' in the title among all shared drives of the organizationname contains 'confidential' and orgUnitId = 'C03az79cb'true
Shared drives with the word 'confidential' in the title among all shared drives that the user is a member ofname contains 'confidential'false
Shared drives with no assigned organizerorganizerCount = 0true
Shared drives that don't contain the organizational unit IDorgUnitId != 'C03az79cb'true

Query multiple terms with parentheses

You can use parentheses to group multiple query terms together. For example, tosearch for shared drives created after a specific date and that either have morethan five organizers or more than 20 members, use this query:

createdTime > '2019-01-01T12:00:00' and (organizerCount > 5 ormemberCount > 20)

This search returns all shared drives created after January 1st, 2019 and thathave more than five organizers or more than 20 members.

The Drive API evaluatesand andor operators from left to right,so the same search without parentheses would return:

  • Only shared drives with more than five organizers that were created afterJanuary 1st, 2019.
  • All shared drives with more than 20 members, even those created beforeJanuary 1st, 2019.

Related topics

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.