minmin
minmin

Reputation: 53

How to get json data from google spreadsheet

I am trying to get JSON data from publicly shared Google SpreadSheets that are created by from other users.

To call that api I use the following url format: https://spreadsheets.google.com/feeds/list/[sheet_id]/[tab_id]/public/basic?alt=json

But when I set the sheet_id from the one I get from a shared link I receive 404 response. :-(

enter image description here

By the way, I can get JSON data from same shared link if I make it public on the web.

Like this:

enter image description here

Can I get json data from only another users shared link?

This is my application condition.

  1. Shared link can be sent from many people.
  2. Those links are not public to the web.
  3. I make sheet_id from shared link and call api.
  4. I run application from api response data.

Thank you for your patience and please excuse my poor English.

Upvotes: 1

Views: 1471

Answers (1)

user94559
user94559

Reputation: 60133

I'm not sure what API method you're using, but this seems to work fine on the example spreadsheet you gave. (Make sure to include your API key.)

GET https://sheets.googleapis.com/v4/spreadsheets/1TlGL9JASdAidux2xAMKKbWOeMEAJswzRUdp4cWqnDzg/values/texts?key=<REDACTED>

Upvotes: 1

Related Questions