Nikunj Chaklasiya
Nikunj Chaklasiya

Reputation: 818

Is there any API available for Retrieve images in the cell from a google spreadsheet?

I'm trying to Retrieve images in the cell from a google spreadsheet. I checked this question is already available. and I also referred to this documentation. But, these both are no longer work. Does anyone suggests me API or provides any good documentation link?

Edited:

This is my Google Sheet. I'm trying to retrieve A4 and A5. Which is I uploaded from local machine. I used this API. But It's given me the blank value. Is there any other API available for retrieving this both images?

Upvotes: 3

Views: 952

Answers (2)

Piotr Kocybik
Piotr Kocybik

Reputation: 121

You can get a zip file with the sheet in html format with all the images – using Google API. I belive it will be easy to parse it and to get the image you need.

  1. Get Your API Key, from Google developers Console

  2. Get a File ID of a google spreadsheet with permissions set to "Anyone with the link".

  3. Now you're ready to call the api (with curl or browser window): https://www.googleapis.com/drive/v3/files/{FILE_ID}/export?mimeType=application%2Fzip&key={YOUR API KEY}

Upvotes: 0

Upesh M
Upesh M

Reputation: 402

You will not be able to retrieve images placed using the "Upload" functionality. To retrieve via API, the image should be placed using

=IMAGE("http://your.url").

So upload your image to a content server, get the URL and insert them to the respective cells using =IMAGE formula. Now if you retrieve the grid data using Spreadsheet.get and locate this specific element in the array, you will get the cell value as =IMAGE("http://your.url"), you can parse this string to retrieve the image URL.

Upvotes: 1

Related Questions