Get JSON feed from published google sheet

I carefully studied this, found many answers on this site, but I just can’t get it to work. I have to miss something.

I have the following open sheet: https://docs.google.com/spreadsheets/d/11CwVCfIiJHlC-PhaT_hD8aB1q77VwecCgOuwzyuwZkY/edit?usp=sharing I am inserting my key https://spreadsheets.google.com/feeds/lcljjlisth11 / listc11 / listc11 PhaT_hD8aB1q77VwecCgOuwzyuwZkY / od6 / public / values? Alt = json

Receive a message that the document is not published.

+5
source share
2 answers

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

1) Menu file > Publish to the Internet ...

enter image description here

2) Click Start Publishing

enter image description here

3) Download the url and you will see it in JSON

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

If, after you have done all this, you will receive the error message Invalid query parameter value for grid_id. refer to this post for solution: Get Google JSON worksheet table

+8
source

You probably need to publish table, because when I tried to open the table with your key, Google says:

 We're sorry. This document is not published. 

To fix this, select the "File / Publish to the Web ..." menu in Google spreadsheets and publish the sheet. Copy the URL from the dialog box and use it in your code.

See the snapshot below to open a similar spreadsheet using Tabletop .

 var url='https://docs.google.com/spreadsheets/d/12VlQDuE1hgArpsJFBHlVbe4XN3CX5qwHvo-58ClMGzU/pubhtml'; alasql('SELECT * INTO HTML("#res",{headers:true}) FROM TABLETOP(?)',[url]); 
 <script src="https://cdn.rawgit.com/jsoma/tabletop/master/src/tabletop.js"></script> <script src="http://alasql.org/console/alasql.min.js"></script> <div id="res"></div> 
+3
source

Source: https://habr.com/ru/post/1211573/


All Articles