- Home
- Google Workspace
- Google Sheets
- Guides
The Google Sheets API is a RESTful interface that lets you read and modify aspreadsheet's data. The most common uses of this API include the followingtasks:
- Create spreadsheets
- Read and write spreadsheet cell values
- Update spreadsheet formatting
- Manage Connected Sheets
Below is a list of common terms used in the Sheets API:
- Spreadsheet
The primary object in Google Sheets that can contain multiple sheets, eachwith structured information contained in cells. ASpreadsheet resource represents every spreadsheet and has aunique spreadsheetId value,containing letters, numbers, hyphens, or underscores. You can find thespreadsheet ID in a Google Sheets URL:
https://docs.google.com/spreadsheets/d/spreadsheetId/edit#gid=0
- Sheet
A page or tab within a spreadsheet. ASheet resource represents each sheet and hasa unique title and numericsheetId value. Youcan find the sheet ID in a Google Sheets URL:
https://docs.google.com/spreadsheets/d/aBC-123_xYz/edit#gid=sheetId
- Cell
An individual field of text or data within a sheet. Cells are arranged inrows and columns, and can be grouped as a range of cells. ACellData resource represents each cell, butit doesn't have a unique ID value. Instead, rowand column coordinates identify the cells.
- A1 notation
A syntax used to define a cell or range of cells with a string thatcontains the sheet name plus the starting and ending cell coordinates usingcolumn letters and row numbers. This method is the most common and usefulwhen referencing an absolute range of cells.
Show examples
Sheet1!A1:B2
refers to the first two cells in the top two rows of Sheet1.Sheet1!A:A
refers to all the cells in the first column of Sheet1.Sheet1!1:2
refers to all the cells in the first two rows of Sheet1.Sheet1!A5:A
refers to all the cells of the first column of Sheet 1, from row 5 onward.A1:B2
refers to the first two cells in the top two rows of the first visible sheet.Sheet1
refers to all the cells in Sheet1.'My Custom Sheet'!A:A
refers to all the cells in the first column of a sheet named "My Custom Sheet." Single quotes are required for sheet names with spaces, special characters, or an alphanumeric combination.'My Custom Sheet'
refers to all the cells in 'My Custom Sheet'.
Tip: Where possible, use distinct names for the objects within your spreadsheets. For example, A1 refers to the cell A1 in the first visible sheet, whereas 'A1' refers to all the cells in a sheet named A1. Similarly, Sheet1 refers to all the cells in Sheet1. However, if there’s a named range titled "Sheet1", then Sheet1 refers to the named range and 'Sheet1' refers to the sheet.
- R1C1 notation
A syntax used to define a cell or range of cells with a string thatcontains the sheet name plus the starting and ending cell coordinates usingrow numbers and column numbers. This method is less common than A1 notation, but can beuseful when referencing a range of cells relative to a given cell'sposition.
Show examples
Sheet1!R1C1:R2C2
refers to the first two cells in the top two rows of Sheet1.R1C1:R2C2
refers to the first two cells in the top two rows of the first visible sheet.Sheet1!R[3]C[1]
refers to the cell that is three rows below and one column to the right of the current cell.
- Named range
A defined cell or range of cells with a custom name to simplifyreferences throughout an application. A FilterView resource represents a named range.
- Protected range
A defined cell or range of cells that cannot be modified. AProtectedRange resource represents a protected range.
Next steps
To learn about developing with Google Workspace APIs, including handlingauthentication and authorization, refer toDevelop on Google Workspace.
To learn how to configure and run a simple Sheets API app, read theQuickstarts overview.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-03-05 UTC.
[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }] [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]