Search
Search your mail and files
GET/api/v1/search
Who can use this: Any signed-in accountAs Markdown
Mail matches on its subject and text, files on their name and text; with q the best matches come first, otherwise the newest. Results come in two lists, mail and drive, each up to limit long. Files someone has shared with you are included, with their address in shared_by. filters shows how your request was read, and indexed is false until something of yours has been indexed.
Parameters
| Name | Where | What it is |
|---|---|---|
| q | query | Words to find. Put a phrase in double quotes, use OR between words for either one, and a minus before a word to leave it out.e.g. invoice |
| person | query | A name or address. Finds mail from or to them, and photos they are tagged in. |
| from | query | Only items dated on or after this day, as YYYY-MM-DD. |
| to | query | Only items dated on or before this day, as YYYY-MM-DD. |
| source | query | both (the default), mail or drive. |
| mailbox | query | Only mail in this folder, spelled as the results' mailbox shows it, such as INBOX. |
| has_attachments | query | 1 for only mail that has attachments. |
| mime | query | Only files of this type, such as image or application/pdf. |
| type_in | query | Only these types, repeated for more than one. A group (cat:pictures), a whole kind (image/*) or one type (image/png). For mail it matches the attachments. |
| type_ex | query | Leave these types out, written the same way as type_in. |
| tag | query | Only photos with this tag, or a tag filed under it. |
| shared | query | What to do with files others have shared with you. include (the default), exclude, or only. |
| in_trash | query | 1 to search your deleted files instead. |
| min_size | query | Only files of at least this many bytes. |
| max_size | query | Only files of at most this many bytes. |
| limit | query | The most results from mail, and from files. 50 if you leave it out, 200 at most. |
| offset | query | Skip this many results first, to get the next page. |
Good to know
- With no words and no filter, nothing is searched and both lists come back empty. Choosing only a
sourcedoesn't count as a filter. - A mail result's
message_idis the search's own number for it, not theuidthat Read a message takes. - Files you have kept out of search (marked private in drive, alone or by their folder) never come back.