fetch-public-google-sheet

Fetch public google sheet data

Usage no npm install needed!

<script type="module">
  import fetchPublicGoogleSheet from 'https://cdn.skypack.dev/fetch-public-google-sheet';
</script>

README

fetch-public-google-sheet

Single-purpose module to get data from an unprotected google sheet without an API key.

It will use the top and left column for keys in the form of {[row]: {[column]: cell}}.

const fetchSheet = require("fetch-public-google-sheet");
const data = fetchSheet("https://docs.google.com/spreadsheets/d/.../edit");

You can also return the data in {[column]: {[row]: cell}} with

const data = fetchSheet("https://docs.google.com/spreadsheets/d/.../edit", {
  indexBy: "column",
}); 

Caution: The function doesn't work properly if you use numbers in your spreadsheet.

Set up your Google Sheet

image image image Copy the link and you are good to go