node-google-spreadsheet icon indicating copy to clipboard operation
node-google-spreadsheet copied to clipboard

Unable to access public sheet

Open geoffsimons opened this issue 8 years ago • 3 comments

I made a sheet publicly viewable and tried to load the info for the sheet and got the following error:

Error: Sheet is private. Use authentication or make public. (see https://github.com/theoephraim/node-google-spreadsheet#a-note-on-authentication for details)

geoffsimons avatar Feb 20 '18 03:02 geoffsimons

@geoffsimons did you see this section of the readme?

Unauthenticated access (read-only access on public docs)
By default, this module makes unauthenticated requests and can therefore only access spreadsheets that are "public".

The Google Spreadsheets Data API reference and developers guide is a little ambiguous about how you access a "published" public Spreadsheet.

If you wish to work with a Google Spreadsheet without authenticating, not only must the Spreadsheet in question be visible to the web, but it must also have been explicitly published using "File > Publish to the web" menu option in the google spreadsheets GUI.

Many seemingly "public" sheets have not also been "published" so this may cause some confusion.

patrickweaver avatar Mar 01 '18 21:03 patrickweaver

FYI - I've just a published a new version of this module which is a complete rewrite using Google's V4 Sheets API (v3 is being deprecated on March 3, 2020). Docs available here - https://theoephraim.github.io/node-google-spreadsheet

You'll need at least an API key to access a public sheet in the new version.

Thanks! 😄

theoephraim avatar Feb 03 '20 18:02 theoephraim

You'll need at least an API key to access a public sheet in the new version.

Does this mean it's no longer possible to use a public sheet as a "database" for a website? It sounds like every user would need to have an API key.

seastan avatar Jan 24 '21 16:01 seastan