Read Google Sheets Rows in Node.js

Reading from a public google sheet document is easy and can help you bootstrap your data fetching for prototypes

Riccardo Giorato
Geek Culture

--

Install Dependencies

yarn add node-sheets dotenv

Create Google API Key

You will need to have a Google API Key that you can get for free with a gmail/gsuite account with these steps:

  1. Register here with your Google account and create a new project “Google Developer Console”

2. Then go in the “Credentials” tab create a new API Keys.

Add the API Key to ENV

Remember to create a “.env” file with this content:

GOOGLE_SHEET_KEY=HERE_YOUR_API_KEY

Using the Sheets module!

const Sheets = require("node-sheets").default;
const dotenv = require("dotenv");
dotenv.config();

--

--