sheets.spreadsheets.values.batchGet
Retrieves values from one or more spreadsheet ranges by ID and range notation, returning the requested cell data as JSON for batch reads.
Instructions
Returns one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges [HTTP GET]. Returns the requested resource as JSON — request bodies are built from the typed parameters (typed flags win over the params map), or read whole from body_file Siblings over the same resource: append, batchClear, batchClearByDataFilter, batchGetByDataFilter, batchUpdate, batchUpdateByDataFilter, clear, get, update.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Extra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe. | |
| params | No | Parameter map merged into the request; typed parameters win. | |
| ranges | No | ||
| dry_run | No | Return the request that would be sent, without sending it. | |
| body_file | No | Read the request body from this file ('-' for stdin) instead of building one from the parameters. | |
| spreadsheetId | Yes | [URL path segment] The ID of the spreadsheet to retrieve data from. | |
| majorDimension | No | [query parameter] The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `ranges=["A1:B2"],majorDimension=RO Values: `DIMENSION_UNSPECIFIED` = The default value, do not use.; `ROWS` = Operates on the rows of a sheet.; `COLUMNS` = Operates on the columns of a sheet.. | |
| valueRenderOption | No | [query parameter] How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE. Values: `FORMATTED_VALUE` = Values will be calculated & formatted in the response according to the cell's formatting. Formatting is based on the spreadsheet's locale, not the requesting user's locale. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then `A2` would return `"$1.23"`.; `UNFORMATTED_VALUE` = Values will be calculated, but not formatted in the reply. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then `A2` would return the number `1.23`.; `FORMULA` = Values will not be calculated. The reply will include the formulas. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then A2 would return `"=A1"`. Sheets treats date and time values as decimal values. This lets you perform arithmetic on them in formulas. For more information on interpreting date and time values, see [About date & time values](https://developers.google.com/workspace/sheets/api/guides/formats#about_date_time_values).. | |
| dateTimeRenderOption | No | [query parameter] How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render opti Values: `SERIAL_NUMBER` = Instructs date, time, datetime, and duration fields to be output as doubles in "serial number" format, as popularized by Lotus 1-2-3. The whole number portion of the value (left of the decimal) counts the days since December 30th 1899. The fractional portion (right of the decimal) counts the time as a fraction of the day. For example, January 1st 1900 at noon would be 2.5, 2 because it's 2 days after December 30th 1899, and .5 because noon is half a day. February 1st 1900 at 3pm would be 33.625. This correctly treats the year 1900 as not a leap year.; `FORMATTED_STRING` = Instructs date, time, datetime, and duration fields to be output as strings in their given number format (which depends on the spreadsheet locale).. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valueRanges | No | ||
| spreadsheetId | No |