question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while fetching spreadsheet from Google

See original GitHub issue

Thank you for this library. We were using the following packages:

"google-spreadsheet-to-json": "^1.0.0",
"googleapis": "^43.0.0",

and they were working fine before but starting Aug 12 we are getting the following error while fetching the same spreadsheet:

OperationalError: Error: HTTP error 404 (Not Found) - <!DOCTYPE html><html lang="en"><head><meta name="description" content="Web word processing, presentations and spreadsheets"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"><link rel="shortcut icon" href="//docs.google.com/favicon.ico"><title>Page Not Found</title><meta name="referrer" content="origin"><link href="//fonts.googleapis.com/css?family=Product+Sans" rel="stylesheet" type="text/css" nonce="sBQomUSdSKNA5ZAXojPK4g"><style nonce="sBQomUSdSKNA5ZAXojPK4g">/* Copyright 2021 Google Inc. All Rights Reserved. */
49s
68	.goog-inline-block{position:relative;display:-moz-inline-box;display:inline-block}* html .goog-inline-block{display:inline}*:first-child+html .goog-inline-

We have not changed anything from our side. Can you please suggest?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

3reactions
chichilattecommented, Oct 28, 2021

Same here. It’s caused by Google pulling the rug on their Sheets v3 API in August 2021. I replaced this module with https://github.com/revolunet/spreadsheet-to-json

It’s nearly a drop-in replacement. My old code was like…

var gsjson = require('google-spreadsheet-to-json')

// Some crazy way to get a token here.
// I was using google-tokens... https://github.com/bradoyler/google-tokens

const rows = await gsjson({
	spreadsheetId: documentId,
	token: token.credentials.access_token
})

New code is…

const { extractSheets } = require("spreadsheet-to-json");

// No token required, just make sure the document is shared (using the document's sharing UI)
// with the client_email mentioned in the service account keyfile.
// How do you get the keyfile? You create one in Google Cloud Console > IAM > Service Accounts.

const { ALL: rows } = await extractSheets({
	spreadsheetKey: documentId,
	credentials: require(`./.hiddenFromGit/my-google-generated-service-account-keyfile.json`),
})
0reactions
darylszecommented, Sep 3, 2021

same here, seems the changes recently from google about privacy affecting this lib

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Google Docs, Sheets, Slides & Forms error ...
On your computer, open Google Drive. · At the top right, click Settings Settings and then Settings. · Turn on Offline setting. ·...
Read more >
About errors where fetching data failed in Google Sheets
This error happens because Google Apps Script — which Google Sheets uses to perform functions like moving data into a sheet — has...
Read more >
Google Sheets- Commonly Returned Errors
A Google Sheet Error 400 typically indicates that the credentials used in the integration are invalid. Try removing and re-adding the integration, updating...
Read more >
Unable to fetch data from Google spreadsheet #2419 - GitHub
You'll need to create an account on the Google API Console. Follow the instructions carefully. OAuth in general is very prone to errors...
Read more >
Getting error in Google App Script to fetch data from JSON api ...
I dont know if you work with google apps script & google sheets. I need the output in google spreadsheets in the active...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found