如何从共享的google电子表格中获取JSON或XML

如何从共享的google电子表格中获取JSON或XML,json,google-apps-script,google-sheets,Json,Google Apps Script,Google Sheets,我需要从共享电子表格请求json。来自互联网的例子不起作用。我尝试: https://spreadsheets.google.com/feeds/worksheet/KEY/private/full https://spreadsheets.google.com/feeds/list/KEY/od3/public/basic?alt=json https://spreadsheets.google.com/feeds/list/KEY/gid3/public/basic?alt=json htt

我需要从共享电子表格请求json。来自互联网的例子不起作用。我尝试:

https://spreadsheets.google.com/feeds/worksheet/KEY/private/full
https://spreadsheets.google.com/feeds/list/KEY/od3/public/basic?alt=json
https://spreadsheets.google.com/feeds/list/KEY/gid3/public/basic?alt=json
https://spreadsheets.google.com/feeds/list/KEY/3/public/basic?alt=json
https://spreadsheets.google.com/feeds/3/KEY/od6/public/basic?alt=json
https://spreadsheets.google.com/feeds/list/3/KEY/od6/public/basic?alt=json
https://spreadsheets.google.com/feeds/list/KEY/od6/public/basic?alt=json
https://spreadsheets.google.com/feeds/cells/KEY/7/public/values
https://spreadsheets.google.com/feeds/cells/KEY/7/private/values?alt==json&callback=JSON_CALLBACK
https://spreadsheets.google.com/feeds/cells/KEY/7/public/basic?alt==json&callback=JSON_CALLBACK
https://spreadsheets.google.com/feeds/cells/KEY/7/public/basic?alt==json-in-script&callback=JSON_CALLBACK
https://spreadsheets.google.com/feeds/list/KEY/od6/public/values?alt=json&callback=importGSS
https://spreadsheets.google.com/feeds/list/KEY/od6/public/values?alt=json
https://spreadsheets.google.com/feeds/list/KEY/od6/public/values?alt=json-in-script
https://spreadsheets.google.com/feeds/list/KEY/od6/public/values?alt=json-in-script&callback=x
https://spreadsheets.google.com/feeds/list/KEY/od6/public/values?alt=json-in-script&callback=
钥匙从哪里来


谷歌会说“无效的请求URI”或“找不到此URL的电子表格。请确保您拥有正确的URL,并且电子表格的所有者没有将其删除。”

看起来您缺少OAuth2内容。其他选项:“谷歌应用脚本html服务”可能是最快和最简单的。GoogleDrive api将允许您下载文件和CSV、HTML或Excel。我想您可能需要将文件转换为JSON/XML,但是有很多代码可以转换。