Accessing a (new-style, public) Google sheet as JSON

后端 未结 5 1744
臣服心动
臣服心动 2020-12-04 08:41

How can I access the contents of a (new-style) Google sheet a JSON? My aim is to access the values from JavaScript, so I need to be able to download the JSON via HTTP.

5条回答
  •  孤城傲影
    2020-12-04 08:51

    Here is the solution

    1. Note your sheet id in the document url (don't use the published url to find the id!)
    2. Publish your sheet, just as html page
    3. Use the id from step 1,
    4. and put it in this url https://spreadsheets.google.com/feeds/cells/{id}/1/public/full?alt=json

    The /1 indicates the first sheet in your document

提交回复
热议问题