傳回試算表中一或多個值的範圍。呼叫端必須指定試算表 ID 和一或多個範圍。
HTTP 要求
GET https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchGet
這個網址使用 gRPC 轉碼語法。
路徑參數
| 參數 | |
|---|---|
| spreadsheetId | 
 要擷取資料的工作表 ID。 | 
查詢參數
| 參數 | |
|---|---|
| ranges[] | 
 要擷取值的範圍的 A1 標示法或 R1C1 標示法。 | 
| majorDimension | 
 結果應使用的主要維度。 舉例來說,如果試算表資料為  | 
| valueRenderOption | 
 輸出內容應如何呈現值。預設轉譯選項為  | 
| dateTimeRenderOption | 
 日期、時間和時間長度應如何在輸出內容中顯示。如果  | 
要求主體
要求主體必須為空白。
回應主體
在試算表中擷取多個值範圍時的回應。
如果成功,回應主體會含有以下結構的資料:
| JSON 表示法 | 
|---|
| {
  "spreadsheetId": string,
  "valueRanges": [
    {
      object ( | 
| 欄位 | |
|---|---|
| spreadsheetId | 
 擷取資料的試算表 ID。 | 
| valueRanges[] | 
 要求的值。ValueRanges 的順序與要求範圍的順序相同。 | 
授權範圍
需要下列其中一種 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
詳情請參閱授權指南。