What is Google Sheets API?

The Google Sheets API is a RESTful interface that lets you read and modify a spreadsheet’s data. The most common uses of this API include creating spreadsheets, reading and writing spreadsheet cell values, update spreadsheet formatting, manage connected sheets, and many more.

Here are the common terms used in Google Sheets API:

  • Spreadsheet – is the primary object In Google Sheets that can contain several sheets, each with structured data in cells.

Every spreadsheet is represented by a Spreadsheet resource and has a unique spreadsheet id value. You can find the spreadsheet ID in a Google Sheets URL:

  • Sheet – A page or tab within a spreadsheet.

Each sheet is represented by a Sheet resource and has a unique title and numeric sheetId value.

  • Cell – is a single text or data field within a sheet. Rows and columns of cells can be combined together to form a range of cells. A CellData resource represents each cell, but it does not have a unique ID value. Instead, the row and column coordinates are used to identify cells.

A1 Notation – A syntax used to define a cell or range of cells with a string that contains the sheet name and starting and ending cell coordinates using column letters and row numbers. This method is most common and useful when referencing an absolute range of cells. Here are some examples of A1 notation:

  • 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 a sheet named “My Custom Sheet.” Single quotes are required for sheet names with spaces, special characters, or an alphanumeric combination.

R1C1 Notation – This method is less common, but can be useful when referencing a range of cells relative to a given cell’s position. Here are some examples of R1C1 Notation:

  • 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.

Leave a Comment

Your email address will not be published. Required fields are marked *