This has not been and will not be updated to work with the current version of google spredsheets API
An awkwardly titled server for accessing CSVs (and a few other things) from Google spreadsheets written in NodeJS and based on Express
I wanted a way to quickly prototype data driven applications without needing to spend too much time upfront modeling data.
Once the app is up and running and ha access to some google sheets then the following routes exists.
[DOMAIN]/data/:sheetId.json A summary of available sheets for a given Google doc specified by :sheetId
[DOMAIN]/data/:sheetId/:worksheetTitle.csv A CSV of the worksheet called :worksheetTitle from the doc specified by :sheetId
[DOMAIN]/data/:sheetId/:worksheetTitle.csv See above, but JSON
[DOMAIN]/data/:sheetId/dictionary/:worksheetTitle-by-:key.json A JSON object where the property defined by :key can be used to look up records
[DOMAIN]/data/:sheetId/find/:key=:value-in-:worksheetTitle.json A JSON array of rows in the worksheet where the :key column is equal to a specified :value can be used for simple filtering
Column names in the spreadsheets can't be id
https://github.com/theoephraim/node-google-spreadsheet
If you are using Heroku or another environment where you cannot save a local file, you may just pass in an object with
client_email -- your service account's email address private_key -- the private key found in the JSON file
Internally, this uses a JWT client to generate a new auth token for your service account that is valid for 1 hour. The token will be automatically regenerated when it expires.
SPECIAL NOTE FOR HEROKU USERS
Save your private key to a text file Replace \n with actual line breaks Replace \u003d with = heroku config:add GOOGLE_PRIVATE_KEY="$(cat yourfile.txt)"