Skip to content

Google Sheets API API

by googleapis.com

OAuthHTTPSAnalytics
Open documentation ↗

Overview

Reads and writes Google Sheets.

Google Sheets API is an analytics API from googleapis.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 17 endpoints.

At a glance

Authentication
OAuth
HTTPS
Yes
CORS
Unknown
Category
Analytics
Base URL
https://sheets.googleapis.com/
Version
v4
Endpoints
17
Spec updated
2023-04-21

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEETID" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEETID", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEETID",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
POST/v4/spreadsheetsCreates a spreadsheet, returning the newly created spreadsheet.
GET/v4/spreadsheets/{spreadsheetId}Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. By default, data within grids is not returned. You can include grid data in
GET/v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}Returns the developer metadata with the specified ID. The caller must specify the spreadsheet ID and the developer metadata's unique metadataId.
POST/v4/spreadsheets/{spreadsheetId}/developerMetadata:searchReturns all developer metadata matching the specified DataFilter. If the provided DataFilter represents a DeveloperMetadataLookup object, this will return all D
POST/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyToCopies a single sheet from a spreadsheet to another spreadsheet. Returns the properties of the newly created sheet.
GET/v4/spreadsheets/{spreadsheetId}/values/{range}Returns a range of values from a spreadsheet. The caller must specify the spreadsheet ID and a range.
PUT/v4/spreadsheets/{spreadsheetId}/values/{range}Sets values in a range of a spreadsheet. The caller must specify the spreadsheet ID, range, and a valueInputOption.
POST/v4/spreadsheets/{spreadsheetId}/values/{range}:appendAppends values to a spreadsheet. The input range is used to search for existing data and find a "table" within that range. Values will be appended to the next r
POST/v4/spreadsheets/{spreadsheetId}/values/{range}:clearClears values from a spreadsheet. The caller must specify the spreadsheet ID and range. Only values are cleared -- all other properties of the cell (such as for
POST/v4/spreadsheets/{spreadsheetId}/values:batchClearClears one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges. Only values are cleared -- all other
POST/v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilterClears one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more DataFilters. Ranges matching any of the speci
GET/v4/spreadsheets/{spreadsheetId}/values:batchGetReturns one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges.
POST/v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilterReturns one or more ranges of values that match the specified data filters. The caller must specify the spreadsheet ID and one or more DataFilters. Ranges that
POST/v4/spreadsheets/{spreadsheetId}/values:batchUpdateSets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more ValueRanges.
POST/v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilterSets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more DataFilterValueRanges.
POST/v4/spreadsheets/{spreadsheetId}:batchUpdateApplies one or more updates to the spreadsheet. Each request is validated before being applied. If any request is not valid then the entire request will fail an
POST/v4/spreadsheets/{spreadsheetId}:getByDataFilterReturns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. This method differs from GetSpreadsheet in that it allows selecting which s

Questions

Does the Google Sheets API API need an API key?

Yes. The Google Sheets API API uses OAuth authentication; the documentation explains how to get credentials.

Does the Google Sheets API API support HTTPS?

Yes, the Google Sheets API API is served over HTTPS.

How many endpoints does the Google Sheets API API have?

Its OpenAPI description lists 17 endpoints in version v4. All of them are shown on this page.

What are alternatives to the Google Sheets API API?

Other Analytics APIs include Google Play Integrity API, versionhistory.googleapis.com API, Doc Converter, Perspective Comment Analyzer API, Safe Browsing API.

Compare alternatives →

Google Play Integrity API

Analytics

The Play Integrity API helps you check that you're interacting with your genuine app on a genuine Android device powered by Google Play services. The Play Integrity API has replaced SafetyNet Attestation and Android Device Verification.

OAuth1 endpoints

versionhistory.googleapis.com API

Analytics

Version History API - Prod

No auth4 endpoints

Doc Converter

Analytics

This api converts file formats of OpenXml and OpenOffice documents formats to vector files (e.g., svg)

No auth1 endpoints

Perspective Comment Analyzer API

Analytics

The Perspective Comment Analyzer API provides information about the potential impact of a comment on a conversation (e.g. it can provide a score for the "toxicity" of a comment). Users can leverage the "SuggestCommentScore" method to submit corrections to improve Perspective over time. Users can set the "doNotStore" flag to ensure that all submitted comments are automatically deleted after scores are returned.

OAuth2 endpoints

Safe Browsing API

Analytics

Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources. The Safe Browsing APIs are for non-commercial use only. If you need to use APIs to detect malicious URLs for commercial purposes – meaning “for sale or revenue-generating purposes” – please refer to the Web Risk API.

No auth7 endpoints

Web Fonts Developer API

Analytics

The Google Web Fonts Developer API lets you retrieve information about web fonts served by Google.

No auth1 endpoints

Listed from APIs.guru (CC0).