Questions tagged [google-sheets-api]

The Google Sheets API lets developers write third-party applications that read and modify any aspect of spreadsheets.

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

3524 questions
19
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". …
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
  • 13,523
  • 9
  • 37
  • 57
18
votes
8 answers

How to connect Google Sheets to Database

I'm trying to auto-populate some raw data on a sheet in my google sheets file with a query. It doesn't look like sheets has any built in functionality to do so like Microsoft Excel does. Am I missing something? I found one add-on that has since…
obizues
  • 1,275
  • 4
  • 13
  • 29
17
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…
17
votes
5 answers

How to export a csv from Google Sheet API?

I can't find any reference to an API that enables Rest API clients to export an existing Google Sheet to a csv file. https://developers.google.com/sheets/ I believe there should be a way to export them.
user1447414
  • 906
  • 1
  • 7
  • 24
17
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
  • 171
  • 1
  • 1
  • 4
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)?
15
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
  • 4,621
  • 4
  • 39
  • 81
15
votes
5 answers

Creating empty spreadsheets in Google Drive using Drive API

I want to create an empty Google Sheet (created only with metadata) in Google Drive. When I referred to the Google SpreadSheet API documentation, it says to use the DocumentsList API, but it's deprecated and instead asks me to use the Google Drive…
14
votes
2 answers

Google Sheets API: The caller does not have permission

I'm trying to read the document from the cron: https://sheets.googleapis.com/v4/spreadsheets/?key= My document is available to anyone with the link. My #1 key settings: Application restrictions: - IP addresses (web servers,…
13
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.
13
votes
2 answers

Create spreadsheet using Google Spreadsheets API in Google Drive

I have successfully created a new worksheet in an existing spreadsheet of My Google Drive account through a simple Java code mentioned in Google's official documentation on Developer Guide Sheets API but want to create a new spreadsheet in my Google…
Satyam Koyani
  • 4,168
  • 2
  • 20
  • 46
12
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…
12
votes
1 answer

Google Sheets java sdk oAuth unauthorized after some hours (spring boot)

I successfully created a spring boot Serviceclass in order to write on google sheets, following the Java Quistart Tutorial for Sheets API My problem is that the authorization is not renewing, so after the first successful authentication via browser,…
user4330585
  • 175
  • 1
  • 9
12
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
  • 428
  • 1
  • 6
  • 16