Created
September 5, 2021 16:24
-
-
Save motyar/d03bf01212d0968ae48c752adc1440d6 to your computer and use it in GitHub Desktop.
Google sheet to JSON link and accessing that data with JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const spreadsheetId = '1bPt3cGhnfvqASOmcpvBQglPqg_fnU6aZktlYA8gqEdw' | |
fetch(`https://docs.google.com/spreadsheets/d/${spreadsheetId}/gviz/tq?tqx=out:json`) | |
.then(res => res.text()) | |
.then(text => { | |
const json = JSON.parse(text.substr(47).slice(0, -2)); | |
console.log(json); | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment