Answer:
Unfortunately, there is currently no way to retrieve images added through Insert > Image
via Sheets API, so all you have are several roundabout ways, which will only be appropriate in certain circumstances.
Feature Requests:
There are several feature requests in Issue Tracker regarding image handling in Sheets API, I'd suggest you to star these in order to keep track of them and to help prioritize its implementation:
Workarounds:
Option 1. Set image through its URL:
If a URL of the image is available and you want to write the image to a specific cell (not over cells
), you could just add the formula =IMAGE(your-image-url)
to the desired cell via spreadsheets.values.update.
Or, if you're open to using Apps Script, you could use insertImage(url, column, row).
Option 2. Copy corresponding range:
If the image was added via Insert > Images > Image in cell
and the destination sheet is on the same spreadsheet as the source sheet, you could make a CopyPasteRequest or a CutPasteRequest to copy or move the range containing the image to the destination sheet (see spreadsheets.batchUpdate).
Option 3. Copy the entire sheet:
If the image was added via Insert > Images > Image over cells
, or if the destination sheet is not on the same spreadsheet as the source sheet, your only option would be to copy the entire sheet via spreadsheets.sheets.copyTo.