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
23
votes
6 answers

Update a Cell with C# and Sheets API v4

Does anyone have a good C# example for updating a cell with the v4 API? I have the get cell values c# example from the developer website working with Google Sheets API v4. I am trying to modify the example to update a cell with a value of "Tom". …
20
votes
3 answers

Appending multiple rows to Spreadsheet - Google Apps Script

I wish to append multiple rows to a google sheet via GAS whilst being considerate of performance and undesired possiblities. To achieve this for a single row, I would use appendRow as this tackles problems with intervening mutations and completes…
dbr
  • 661
  • 1
  • 8
  • 21
19
votes
3 answers

Remove only formatting on a cell range selection with google spreadsheet API

I am looking for a way to remove only formatting on a cell range selection, not their content, using Google sheet API with python. For now, the only solution I have is to apply the same logic as a normal format and setting the style to NONE. For…
19
votes
5 answers

How to import a CSV file using Google Sheets API V4

Background I'm developing a Python 2.7 script that analyzes data from an SQL table and at the end, generates a CSV file. Once the file is generated, I'm logging into my google sheet account and use the import option to import my CSV file into the…
idanshmu
  • 5,061
  • 6
  • 46
  • 92
19
votes
3 answers

How do I access the Google Spreadsheets API in PHP?

Starting with the Google Developer documentation on the Google Spreadsheets API, I found that "A number of client libraries are provided in various languages.", but Google only provides client libraries for Java and .NET. For a PHP library, they…
Jo Sprague
  • 16,523
  • 10
  • 42
  • 62
18
votes
2 answers

Access Google Sheets on Google Colaboratory

Hi I am using Google Colaboratory (similar to Jupyter Notebook). Does anyone know how to access data from Google Sheets using Google Colaboratory notebook?
AI2.0
  • 313
  • 1
  • 3
  • 7
18
votes
3 answers

Insert image into Google Sheets cell using Google Sheets API

In google apps Script you can insert an image into Google Spreadsheets using the insertImage function (https://developers.google.com/apps-script/reference/spreadsheet/sheet#insertimageblob-column-row). But I'm not using appscript. I'm using the…
dedles
  • 606
  • 2
  • 8
  • 20
18
votes
4 answers

Google Sheets API v4 receives HTTP 401 responses for public feeds

I'm having no luck getting a response from v4 of the Google Sheets API when running against a public (i.e. "Published To The Web" AND shared with "Anyone On The Web") spreadsheet. The relevant documentation states: "If the request doesn't require…
Jon Shrike
  • 181
  • 1
  • 1
  • 4
18
votes
6 answers

How to convert Google spreadsheet's worksheet string id to integer index (GID)?

To export google spreadsheet's single worksheet to CSV, integer worksheet index(GID) is required to be passed. https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=%s&gid=%d&exportFormat=csv But, where are those informations?…
Ray Yun
  • 1,571
  • 3
  • 16
  • 22
17
votes
3 answers

Request specific file permissions with Google Sheets / Google Drive API

I'm using the Google Sheets API to obtain sheet data for a Java project. All works as expected locally, but I'm using the verbose permissions scope https://www.googleapis.com/auth/spreadsheets which "Allows read/write access to the user's sheets and…
17
votes
5 answers

How to use sheet ID in Google Sheets API?

Google Sheets document can contain some sheets. First is default and '0'. Generally for any sheet there is address like this: https://docs.google.com/spreadsheets/d/(spreadsheetId)/edit#gid=(sheetId) with both spreadsheetId and sheetId. But in API…
Daniel
  • 7,684
  • 7
  • 52
  • 76
17
votes
4 answers

Get the list of all spreadsheets associated with Google account using Sheets API v4

Using Google Sheets API v4, I am looking to get the list of spreadsheets attached to my account. I did much research but have not found any solutions for that.
Gaurav Ashara
  • 462
  • 2
  • 6
  • 16
17
votes
3 answers

Google Spreadsheet - Insert cut/copied cells/rows

Google Spreadsheet doesn't have the functionality to "insert cut cells" like in Excel. Let's say I selected A4 to B5, hit Ctrl+X. Then I moved the selection to A2. Now I want to "insert cut cells", probably by inserting blank cells and moving the…
Aximili
  • 28,626
  • 56
  • 157
  • 216
17
votes
3 answers

What is an example of using OAuth 2.0 and Google Spreadsheet API with Java?

Where is example code showing how to use the Google Data Java Client Library and its support for OAuth 2.0 with the Google Spreadsheet API (now called the Google Sheets API)?
user2952212
  • 230
  • 1
  • 3
  • 7
17
votes
1 answer

How do I create a Google Spreadsheet with a service account and share to other google users in java?

I have an application where I, with a Google Service Account, gather lots of information about my site from the Analytics API. My next step is to create a spreadsheet with the service account and share the document with a couple of users. I have…
jakob
  • 5,979
  • 7
  • 64
  • 103