Google Sheets API の概要
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google Sheets API は、スプレッドシートのデータの読み取りと変更を可能にする RESTful インターフェースです。Sheets API を使用すると、次のことができます。
- スプレッドシートを作成する
- スプレッドシートのセル値の読み取りと書き込み
- スプレッドシートの書式設定を更新する
- コネクテッド シートを管理する
以下に、Sheets API で使用される一般的な用語を示します。
- スプレッドシート
Google スプレッドシートの主要なオブジェクト。これには、それぞれ Cells
に含まれる構造化された情報を持つ複数の Sheets
を含めることができます。spreadsheets
リソースは、スプレッドシートを表します。一意の spreadsheetId
値が含まれています。
- スプレッドシート ID
- スプレッドシートの一意の識別子。スプレッドシートを参照する文字、数字、一部の特殊文字を含む特定の文字列で、スプレッドシートの URL から取得できます。スプレッドシート ID は、スプレッドシートの名前が変更されても変わりません。
https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit?gid=SHEET_ID#gid=SHEET_ID
- スプレッドシート
スプレッドシート内のページまたはタブ。Sheets
リソースはシートを表します。SheetProperties
オブジェクトの一部として、一意の数値 sheetId
値とシート title
が含まれています。
- シート ID
- スプレッドシート内の特定のシートの一意の識別子。シートを参照する数値を含む特定の整数で、スプレッドシートの URL から取得できます。シート ID は、シート名が変更されても安定しています。例については、スプレッドシート ID をご覧ください。
- Cell
シート内のテキストまたはデータの個々のフィールド。セルは行と列に配置され、セル範囲としてグループ化できます。Cells
リソースは各セルを表しますが、一意の ID 値はありません。代わりに、行と列の座標でセルを識別します。
- A1 表記
- シート名と、列文字と行番号を使用した開始セルと終了セルの座標を含む文字列で、セルまたはセルの範囲を定義するために使用される構文。この方法は、セルの絶対範囲を参照する場合に最も一般的で便利です。
Sheet1!A1:B2
は、Sheet1 の最初の 2 行と 2 列のすべてのセルを指します。
Sheet1!A:A
は、Sheet1 の 1 列目のすべてのセルを指します。
Sheet1!1:2
は、シート 1 の最初の 2 行のすべてのセルを指します。
Sheet1!A5:A
は、シート 1 の最初の列の 5 行目以降のすべてのセルを指します。
A1:B2
は、最初の表示シートの最初の 2 行と列のすべてのセルを指します。
Sheet1
は、Sheet1 のすべてのセルを指します。
'Jon's_Data'!A1:D5
は、「Jon's_Data」というシートの最初の 5 行と 4 列のすべてのセルを参照します。
'My Custom Sheet'!A:A
は、「My Custom Sheet」という名前のシートの最初の列のすべてのセルを指します。
'My Custom Sheet'
は、「My Custom Sheet」のすべてのセルを指します。
スペースまたは特殊文字を含むシート名には、単一引用符が必要です。
ヒント: 可能な場合は、スプレッドシート内のオブジェクトに異なる名前を使用してください。たとえば、A1(引用符なし)は、最初に表示されるシートのセル A1 を指します。'A1'
は、A1 という名前のシートを参照します。同様に、Sheet1 は Sheet1 という名前のシートを参照します。ただし、「Sheet1」という名前の範囲がある場合、Sheet1 は名前付き範囲を参照し、'Sheet1'
はシートを参照します。
- R1C1 表記
- シート名と、行番号と列番号を使用して開始セルと終了セルの座標を含む文字列で、セルまたはセルの範囲を定義するために使用される構文。この方法は A1 形式ほど一般的ではありませんが、特定のセルの位置を基準としてセルの範囲を参照する場合に便利です。
Sheet1!R1C1:R2C2
は、Sheet1 の最初の 2 行の最初の 2 つのセルを参照します。
R1C1:R2C2
は、最初に表示されるシートの上 2 行の最初の 2 つのセルを参照します。
Sheet1!R[3]C[1]
は、現在のセルの 3 行下、1 列右のセルを指します。
- 名前付き範囲
- アプリ全体で参照を簡素化するためにカスタム名が付けられた、定義済みのセルまたはセル範囲。
FilterView
リソースは、名前付き範囲を表します。 - 保護されている範囲
- 変更できない定義済みのセルまたはセル範囲。
ProtectedRange
リソースは、保護された範囲を表します。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-29 UTC。
[null,null,["最終更新日 2025-08-29 UTC。"],[],[],null,["# Google Sheets API Overview\n\nThe Google Sheets API is a RESTful interface that lets you read and modify a\nspreadsheet's data. The Sheets API lets you:\n\n- Create spreadsheets\n- Read and write spreadsheet cell values\n- Update spreadsheet formatting\n- Manage Connected Sheets\n\nThe following is a list of common terms used in the Sheets API:\n\n*Spreadsheet*\n\n: The primary object in Google Sheets. It can contain multiple `Sheets`, each\n with structured information contained in `Cells`. The\n [`spreadsheets`](/workspace/sheets/api/reference/rest/v4/spreadsheets)\n resource represents a spreadsheet. It contains a unique `spreadsheetId`\n value.\n\n *Spreadsheet ID*\n : The unique identifier for a spreadsheet. It's a particular string\n containing letters, numbers, and some special characters that reference a\n spreadsheet and it can be derived from the spreadsheet's URL. Spreadsheet\n IDs are stable, even if the spreadsheet name changes. \n\n https://docs.google.com/spreadsheets/d/\u003cvar translate=\"no\"\u003eSPREADSHEET_ID\u003c/var\u003e/edit?gid=\u003cvar translate=\"no\"\u003eSHEET_ID\u003c/var\u003e#gid=\u003cvar translate=\"no\"\u003eSHEET_ID\u003c/var\u003e\n\n*Sheet*\n\n: A page or tab within a spreadsheet. The\n [`Sheets`](/workspace/sheets/api/reference/rest/v4/spreadsheets/sheets) resource\n represents a sheet. It contains a unique numeric `sheetId` value and sheet\n `title` as part of the\n [`SheetProperties`](/workspace/sheets/api/reference/rest/v4/spreadsheets/sheets#sheetproperties)\n object.\n\n *Sheet ID*\n : The unique identifier for a specific sheet within a spreadsheet. It's a\n particular integer containing numbers that reference a sheet and it can be\n derived from the spreadsheet's URL. Sheet IDs are stable, even if the sheet\n name changes. For an example, see [Spreadsheet ID](#spreadsheet-id).\n\n*Cell*\n\n: An individual field of text or data within a sheet. Cells are arranged in rows\n and columns, and can be grouped as a range of cells. The\n [`Cells`](/workspace/sheets/api/reference/rest/v4/spreadsheets/cells)\n resource represents each cell, but it doesn't have a unique ID value.\n Instead, row and column coordinates identify the cells.\n\n *A1 notation*\n : A syntax used to define a cell or range of cells with a string that\n contains the sheet name plus the starting and ending cell coordinates using\n column letters and row numbers. This method is the most common and useful\n when referencing an absolute range of cells.\n - `Sheet1!A1:B2` refers to all the cells in the first two rows and columns of Sheet1.\n - `Sheet1!A:A` refers to all the cells in the first column of Sheet1.\n - `Sheet1!1:2` refers to all the cells in the first two rows of Sheet1.\n - `Sheet1!A5:A` refers to all the cells of the first column of Sheet 1, from row 5 onward.\n - `A1:B2` refers to all the cells in the first two rows and columns of the first visible sheet.\n - `Sheet1` refers to all the cells in Sheet1.\n - `'Jon's_Data'!A1:D5` refers to all the cells in the first five rows and four columns of a sheet named \"Jon's_Data.\"\n - `'My Custom Sheet'!A:A` refers to all the cells in the first column of a sheet named \"My Custom Sheet.\"\n - `'My Custom Sheet'` refers to all the cells in \"My Custom Sheet\".\n\n Single quotes are required for sheet names with spaces or special characters.\n\n **Tip** : Where possible, use distinct names for objects in your spreadsheets. For example, A1 (without quotes) refers to cell A1 in the first visible sheet. `'A1'` refers to a sheet with the name A1. Similarly, Sheet1 refers to a sheet with the name Sheet1. However, if there's a named range titled \"Sheet1\", then Sheet1 refers to the named range and `'Sheet1'` refers to the sheet.\n\n *R1C1 notation*\n : A syntax used to define a cell or range of cells with a string that\n contains the sheet name plus the starting and ending cell coordinates using\n row numbers and column numbers. This method is less common than A1 notation,\n but can be useful when referencing a range of cells relative to a given\n cell's position.\n - `Sheet1!R1C1:R2C2` refers to the first two cells in the top two rows of Sheet1.\n - `R1C1:R2C2` refers to the first two cells in the top two rows of the first visible sheet.\n - `Sheet1!R[3]C[1]` refers to the cell that is three rows below and one column to the right of the current cell.\n\n *Named range*\n : A defined cell or range of cells with a custom name to simplify references\n throughout an application. A\n [`FilterView`](/workspace/sheets/api/reference/rest/v4/spreadsheets/sheets#filterview)\n resource represents a named range.\n\n *Protected range*\n : A defined cell or range of cells that cannot be modified. A\n [`ProtectedRange`](/workspace/sheets/api/reference/rest/v4/spreadsheets/sheets#protectedrange)\n resource represents a protected range.\n\nRelated topics\n--------------\n\n- To learn about developing with Google Workspace APIs, including handling\n authentication and authorization, refer to [Develop on\n Google Workspace](/workspace/guides/get-started).\n\n- To learn how to configure and run a Sheets API app, try the\n [JavaScript quickstart](/workspace/sheets/api/quickstart/js)."]]