Search code examples
google-docs-api

Is there a way to query the Google Documents List API for ONLY images?


Say I want to retrieve only the images a user has uploaded to their Google Docs account. I know that an API query can be constructed to exclusively retrieve Google Docs of a particular category (e.g., collections, documents, spreadsheets, etc.).

There is an advanced search option in the Google Docs web interface to show only "Images". I've tried a couple of likely keywords (image, etc.) but haven't stumbled upon the right one. Does anyone know of a way to do this via the API?


Solution

  • You can use the full text query operators to accomplish that:

    GET https://docs.google.com/feeds/default/private/full?v=3&q=type:image&prettyprint=true
    

    This query requests all documents of type "image" using version 3.0 of the API and a pretty-printed response XML.