You can search or filter files using the
These methods accept the
q parameter which supports the same
advanced search syntax as
the Gmail web-interface. This means you can use search queries to filter
messages by properties such as the sender, date, or label to name a few
possibilities. For example, the following query retrieves all messages sent by
the user between Jan 1, 2014 and Jan 30, 2014:
GET https://www.googleapis.com/gmail/v1/users/me/messages?q="in:sent after:2014/01/01 before:2014/01/30"
In addition to search queries, you can also filter messages and threads by label
labelIds parameter. This allows you to search for messages and
threads with the specified system or user labels applied. For more information,
threads.list method reference.