How to automatically import data from uploaded CSV or XLS file into Google Sheets

You can programmatically import data from a csv file in your Drive into an existing Google Sheet using Google Apps Script, replacing/appending data as needed. Below is some sample code. It assumes that: a) you have a designated folder in your Drive where the CSV file is saved/uploaded to; b) the CSV file is named … Read more

Download a spreadsheet from Google Drive / Workspace using Python

The https://github.com/burnash/gspread library is a newer, simpler way to interact with Google Spreadsheets, rather than the old answers to this that suggest the gdata library which is not only too low-level, but is also overly-complicated. You will also need to create and download (in JSON format) a Service Account key: https://console.developers.google.com/apis/credentials/serviceaccountkey Here’s an example of … Read more

Get list of sheets and latest sheet in google spreadsheet api v4 in Python

You can get a list of sheets by using the “get” method on spreadsheets: sheet_metadata = service.spreadsheets().get(spreadsheetId=spreadsheet_id).execute() sheets = sheet_metadata.get(‘sheets’, ”) title = sheets[0].get(“properties”, {}).get(“title”, “Sheet1”) sheet_id = sheets[0].get(“properties”, {}).get(“sheetId”, 0)

Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential

Not possible. You need to use the OAuth login as indicated here in spreadsheets.values.batchUpdate: You can see on the authorization part that it uses OAuth scopes, therefore it follows that it uses OAuth not API KEY: Authorization Requires one of the following OAuth scopes: https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/spreadsheets

Google spreadsheet api Request had insufficient authentication scopes

Firstly delete the credentials files ~/.credentials/sheets.googleapis.com-nodejs-quickstart.json (depending on your setting) Change the scope variable used for reading cells from Google Spreadsheets from var SCOPES = [‘https://www.googleapis.com/auth/spreadsheets.readonly‘]; to var SCOPES = [‘https://www.googleapis.com/auth/spreadsheets‘]; After the execution of code, API will authenticate again and then the issue will be resolved.

How do I access (read, write) Google Sheets spreadsheets with Python?

(Jun-Dec 2016) Most answers here are now out-of-date as: 1) GData APIs are the previous generation of Google APIs, and that’s why it was hard for @Josh Brown to find that old GData Docs API documentation. While not all GData APIs have been deprecated, all newer Google APIs do not use the Google Data protocol; … Read more

Accessing Google Spreadsheets with C# using Google Data API

According to the .NET user guide: Download the .NET client library: Add these using statements: using Google.GData.Client; using Google.GData.Extensions; using Google.GData.Spreadsheets; Authenticate: SpreadsheetsService myService = new SpreadsheetsService(“exampleCo-exampleApp-1”); myService.setUserCredentials(“jo@gmail.com”, “mypassword”); Get a list of spreadsheets: SpreadsheetQuery query = new SpreadsheetQuery(); SpreadsheetFeed feed = myService.Query(query); Console.WriteLine(“Your spreadsheets: “); foreach (SpreadsheetEntry entry in feed.Entries) { Console.WriteLine(entry.Title.Text); } Given … Read more

How can I access Google Sheet spreadsheets only with Javascript?

I have created a simple javascript library that retrieves google spreadsheet data (if they are published) via the JSON api: https://github.com/mikeymckay/google-spreadsheet-javascript You can see it in action here: http://mikeymckay.github.com/google-spreadsheet-javascript/sample.html