Search for shared drives Stay organized with collections Save and categorize content based on your preferences.
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:
Note: Most query terms requirequery_termis the query term or field to search upon.useDomainAdminAccess=true. For moreinformation about this flag, seedrives.list.operatorspecifies the condition for the query term.valuesare the specific values you want to use to filter your searchresults.
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=falseQuery 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'.
q parameter, whereorganizerCount =0 is encoded asorganizerCount+%3d+0. Client libraries handle this encodingautomatically.| What you want to query | Example | useDomainAdminAccess setting |
|---|---|---|
| Shared drives created after June 1, 2017 | createdTime > '2017-06-01T12:00:00' | true |
| Shared drives visible in the default view | hidden = false | false |
| Shared drives with more than one member | memberCount > 1 | true |
| Shared drives with the word 'confidential' in the title and 20 or more members | name contains 'confidential' and memberCount >= 20 | true |
| Shared drives with the word 'confidential' in the title among all shared drives of the organization | name 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 of | name contains 'confidential' | false |
| Shared drives with no assigned organizer | organizerCount = 0 | true |
| Shared drives that don't contain the organizational unit ID | orgUnitId != '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.