Method: spreadsheets.values.get
スプレッドシートから値の範囲を返します。呼び出し元は、スプレッドシート ID と範囲を指定する必要があります。
HTTP リクエスト
GET https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
spreadsheetId |
string
データを取得するスプレッドシートの ID。
|
range |
string
値を取得する範囲の A1 表記または R1C1 表記。
|
クエリ パラメータ
パラメータ |
majorDimension |
enum (Dimension )
結果で使用するメジャー ディメンション。 たとえば、シート 1 のスプレッドシートのデータが A1=1,B1=2,A2=3,B2=4 の場合、range=Sheet1!A1:B2?majorDimension=ROWS をリクエストすると [[1,2],[3,4]] が返され、range=Sheet1!A1:B2?majorDimension=COLUMNS をリクエストすると [[1,3],[2,4]] が返されます。
|
valueRenderOption |
enum (ValueRenderOption )
出力での値の表現方法。デフォルトのレンダリング オプションは FORMATTED_VALUE です。
|
dateTimeRenderOption |
enum (DateTimeRenderOption )
日付、時刻、期間を出力でどのように表現するか。valueRenderOption が FORMATTED_VALUE の場合は無視されます。デフォルトの dateTime レンダリング オプションは SERIAL_NUMBER です。
|
リクエスト本文
リクエストの本文は空にする必要があります。
レスポンスの本文
成功した場合、レスポンスの本文には ValueRange
のインスタンスが含まれます。
認可スコープ
次の OAuth スコープのいずれかが必要です。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/spreadsheets.readonly
詳しくは、承認ガイドをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-09-05 UTC。
[null,null,["最終更新日 2024-09-05 UTC。"],[[["This Google Sheets API endpoint retrieves a range of values from a specified spreadsheet and range using an HTTP GET request."],["Users need to provide the `spreadsheetId` and `range` as path parameters in the request URL."],["Optional query parameters allow customization of the output, including `majorDimension`, `valueRenderOption`, and `dateTimeRenderOption`."],["The response body, upon successful execution, will contain a `ValueRange` object with the requested data."],["Authorization is required using one of the specified OAuth scopes related to Google Drive or Google Sheets access."]]],["This describes retrieving data from a spreadsheet using a `GET` HTTP request. The request URL includes the `spreadsheetId` and `range` as path parameters. Optional query parameters, like `majorDimension`, `valueRenderOption`, and `dateTimeRenderOption`, allow customization of the returned data. The request body must be empty. The response contains the spreadsheet data in `ValueRange` format if the request is successful. Authentication requires specific OAuth scopes for access.\n"]]