Method: spreadsheets.values.get
傳回試算表中某個範圍的值。呼叫者必須指定試算表 ID 和範圍。
HTTP 要求
GET https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
spreadsheetId |
string
要做為擷取資料的來源試算表 ID。
|
range |
string
範圍的 A1 標記法或 R1C1 標記法,用於擷取值。
|
查詢參數
參數 |
majorDimension |
enum (Dimension )
結果要使用的主要維度。 舉例來說,如果 Sheet1 中的試算表資料為: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
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-05 (世界標準時間)。
[null,null,["上次更新時間:2024-09-05 (世界標準時間)。"],[[["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"]]