Questions tagged [google-sheets-api]

The Google Sheets API lets developers write third-party applications that read and modify any aspect of spreadsheets. Not to be confused with [google-apps-script]

The Google Sheets REST API enables developers to create applications that read and modify the data in Google Sheets.

This API is useful for:

  • Managing the worksheets in a Google Sheets file
  • Consuming the rows of a worksheet
  • Managing cells in a worksheet by position
  • Performing complex formatting of cell text

Example quickstarts are available for most popular languages, along with Google-provided client libraries.

References

6071 questions
11
votes
1 answer

How to create a sheet under a specific folder with google API for python?

I am able to create a sheet with the code below in the root of ‘My Drive’ but how do I create the sheet under a folder in “My Drive” or “Shared drives”? from googleapiclient.discovery import build service = build(‘sheets’, ‘v4’,…
11
votes
0 answers

Google Sheets API Failing with 500

I made this URL public a few years ago as a way to retrieve data. It was working yesterday. Today my site is crashing as it relies on this data, but google is now returning a 500 error if I try to retrieve it programmatically (through…
Luke Schlangen
  • 3,722
  • 4
  • 34
  • 69
11
votes
2 answers

Updating cell values with formulas results in apostrophe prefixes with Sheets API

I'm using gspread and the Google Sheets API to update cell values, setting cell.value equal to a string of a specific formula. Example code: # Calculates sum of cells in current row from column B to H G_SHEETS_ROW_SUM_COMMAND =…
Lukas Velikov
  • 562
  • 4
  • 16
11
votes
2 answers

Google Sheets API. The request is missing a valid API key. [403]

I'm using .net package Google.Apis.Sheets.v4 Client Library. Everything was fine, but last time (about a week ago) there is an error: The request is missing a valid API key. [403] when I'm trying to batchGet with 150+ ranges in a query. If I split…
lagrange-
  • 215
  • 1
  • 2
  • 9
11
votes
1 answer

Build google chart by using google script and query function

From a spreadsheet and using google script, I'm trying to select a range of data from a specific sheet with conditions (where) by using 'query' function. But I don't want to regenerate another sheet with the new range of selected data. Next after I…
11
votes
5 answers

Set cell background color and text size using Google Java API

I want to set Spreadsheet cell background color and text size. I use this Java code to set the text into the cell but I can't find a solution how to set the style. CellData setUserEnteredValue = new CellData() .setUserEnteredValue(new…
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
11
votes
1 answer

List names of sheets in Google Sheets and skip the first two

I found code to list the names of all the sheets in Google Sheets (from here): function SheetNames() { // Usage as custom function: =SheetNames( GoogleClock() ) try { var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets() var out = new…
Nathan
  • 1,483
  • 3
  • 18
  • 41
11
votes
4 answers

How do I connect Android apps with Google Sheets spreadsheets?

I'm trying to do an Android app that needs to work with Google spreadsheet API. I'm new in this, so I'm starting with the version 3 of the api: https://developers.google.com/google-apps/spreadsheets/ I followed all the steps, downloaded all the jar…
10
votes
5 answers

ExceptionInInitializerError in Android app?

In my Android app the WebView activity class has following line, webView.addJavascriptInterface(new JSInterface(this), "Android"); And in JSInterface class, I'm initializing Google "SpreadSheetService" like below, import…
Naveen
  • 1,040
  • 4
  • 15
  • 38
10
votes
2 answers

Can GKE Workload Identity be used to access Google Sheets?

I'm currently using GKE Workload Identity to access Google Cloud Platform resources from within GKE. This works very well for Google Cloud Storage and other platform resources. However, I encounter an issue with "insufficient authentication scopes"…
10
votes
4 answers

Use Google Sheets Java API with API key not OAuth?

Is there a way to use "Google Sheet Java API" with API key not with OAuth which is given in their examples https://developers.google.com/sheets/api/quickstart/java I know you can use HTTP request to get data with API key but I was thinking if there…
Mayank Wadhwa
  • 1,673
  • 17
  • 20
10
votes
1 answer

How to AutoFit column width with Google Sheets API?

Is there any way to AutoFit Column width in Google Sheets using Google Sheets API? I can find only DimensionProperties but it needs exact value n pixels.
GhostKU
  • 1,898
  • 6
  • 23
  • 32
10
votes
1 answer

"Encountered an error while globbing file pattern" error when using BigQuery API w/ Google Sheets

When trying the access a federated source (Google sheets) from BigQuery API, the following error is thrown: [..] "errorResult" : { "location" : "/gdrive/id/", "message" : "Encountered an error while globbing file…
Graham Polley
  • 14,393
  • 4
  • 44
  • 80
10
votes
1 answer

Sharing Google sheet with service account email

I wrote a script to connect to a Google spreadsheet and load data into a postgresql database from it. I already created a service account and obtained the necessary credentials for it in a .json format,the problem is when I try to share the google…
johan855
  • 1,578
  • 4
  • 26
  • 51
10
votes
4 answers

Freeze rows and set styles with Google spreadsheet API

If i scroll the spreadsheet ,header field of the rows are hidden and I need bold text format in the same spreadsheet. Question Can I set the freeze rows and styles through the spreadsheet api - Is it possible?
user3323803
  • 133
  • 1
  • 8