Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get JSON feed from published Google sheet

I have thorougly researched this, found many answers on this site, but just can't get it to work. I must be missing something.

I have the following public sheet: https://docs.google.com/spreadsheets/d/11CwVCfIiJHlC-PhaT_hD8aB1q77VwecCgOuwzyuwZkY/edit?usp=sharing I paste in my key https://spreadsheets.google.com/feeds/list/11CwVCfIiJHlC-PhaT_hD8aB1q77VwecCgOuwzyuwZkY/od6/public/values?alt=json

Get an error that the document is not published.

like image 916
Michael Fallon Avatar asked Jan 21 '15 03:01

Michael Fallon


People also ask

Can you make API calls from Google Sheets?

Calling a REST API in Google Sheets is as easy as installing the Apipheny app, then opening the app in your Google Sheet, entering your API request, and clicking “Run”. Keep reading for instructions on how to import REST API data into Google Sheets.


1 Answers

As agershun already pointed out, you need to publish the document. Follow these steps:

1) File menu > Publish to the web...

enter image description here

2) Click the Start Publishing button

enter image description here

3) Load your URL and you'll see it in JSON

Note: Here is my working example, the URL formed exactly like yours, except this one is published: https://spreadsheets.google.com/feeds/list/1qym45VIwM4ruaWDkqndaOBzgOMAhOsjZ7rL76wJrTkY/od6/public/values?alt=json

If after you've done all this and you receive the error Invalid query parameter value for grid_id. then refer to this post for a solution: Retrieve Google Spreadsheet Worksheet JSON

like image 129
ThisClark Avatar answered Sep 21 '22 00:09

ThisClark