Google Sheets API
  1. spreadsheets
Google Sheets API
  • spreadsheets
    • /v4/spreadsheets
      POST
    • /v4/spreadsheets/{spreadsheetId}
      GET
    • /v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}
      GET
    • /v4/spreadsheets/{spreadsheetId}/developerMetadata:search
      POST
    • /v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo
      POST
    • /v4/spreadsheets/{spreadsheetId}/values/{range}
      GET
    • /v4/spreadsheets/{spreadsheetId}/values/{range}
      PUT
    • /v4/spreadsheets/{spreadsheetId}/values/{range}:append
      POST
    • /v4/spreadsheets/{spreadsheetId}/values/{range}:clear
      POST
    • /v4/spreadsheets/{spreadsheetId}/values:batchClear
      POST
    • /v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter
      POST
    • /v4/spreadsheets/{spreadsheetId}/values:batchGet
      GET
    • /v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter
      POST
    • /v4/spreadsheets/{spreadsheetId}/values:batchUpdate
      POST
    • /v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter
      POST
    • /v4/spreadsheets/{spreadsheetId}:batchUpdate
      POST
    • /v4/spreadsheets/{spreadsheetId}:getByDataFilter
      POST
  1. spreadsheets

/v4/spreadsheets/{spreadsheetId}/values/{range}:append

POST
/v4/spreadsheets/{spreadsheetId}/values/{range}:append
spreadsheets
Appends values to a spreadsheet. The input range is used to search for existing data and find a "table" within that range. Values will be appended to the next row of the table, starting with the first column of the table. See the guide and sample code for specific details of how tables are detected and data is appended. The caller must specify the spreadsheet ID, range, and a valueInputOption. The valueInputOption only controls how the input data will be added to the sheet (column-wise or row-wise), it does not influence what cell the data starts being written to.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://sheets.googleapis.com//v4/spreadsheets//values/:append' \
--header 'Content-Type: application/json' \
--data-raw '{
    "majorDimension": "DIMENSION_UNSPECIFIED",
    "range": "string",
    "values": [
        [
            null
        ]
    ]
}'
Response Response Example
{
    "spreadsheetId": "string",
    "tableRange": "string",
    "updates": {
        "spreadsheetId": "string",
        "updatedCells": 0,
        "updatedColumns": 0,
        "updatedData": {
            "majorDimension": "DIMENSION_UNSPECIFIED",
            "range": "string",
            "values": [
                [
                    null
                ]
            ]
        },
        "updatedRange": "string",
        "updatedRows": 0
    }
}

Request

Path Params
spreadsheetId
string 
required
The ID of the spreadsheet to update.
range
string 
required
The A1 notation of a range to search for a logical table of data. Values are appended after the last row of the table.
Query Params
includeValuesInResponse
string 
optional
Determines if the update response should include the values of the cells that were appended. By default, responses do not include the updated values.
insertDataOption
string 
optional
How the input data should be inserted.
responseDateTimeRenderOption
string 
optional
Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.
responseValueRenderOption
string 
optional
Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
valueInputOption
string 
optional
How the input data should be interpreted.
Body Params application/json
Data within a range of the spreadsheet.
majorDimension
enum<string> 
optional
The major dimension of the values. For output, if the spreadsheet data is: A1=1,B1=2,A2=3,B2=4, then requesting range=A1:B2,majorDimension=ROWS will return [[1,2],[3,4]], whereas requesting range=A1:B2,majorDimension=COLUMNS will return [[1,3],[2,4]]. For input, with range=A1:B2,majorDimension=ROWS then [[1,2],[3,4]] will set A1=1,B1=2,A2=3,B2=4. With range=A1:B2,majorDimension=COLUMNS then [[1,2],[3,4]] will set A1=1,B1=3,A2=2,B2=4. When writing, if this field is not set, it defaults to ROWS.
Allowed values:
DIMENSION_UNSPECIFIEDROWSCOLUMNS
range
string 
optional
The range the values cover, in A1 notation. For output, this range indicates the entire requested range, even though the values will exclude trailing rows and columns. When appending values, this field represents the range to search for a table, after which values will be appended.
values
array [array] 
optional
The data that was read or to be written. This is an array of arrays, the outer array representing all the data and each inner array representing a major dimension. Each item in the inner array corresponds with one cell. For output, empty trailing rows and columns will not be included. For input, supported value types are: bool, string, and double. Null values will be skipped. To set a cell to an empty value, set the string value to an empty string.
optional
Examples

Responses

🟢200Successful response
application/json
Body
The response when updating a range of values in a spreadsheet.
spreadsheetId
string 
optional
The spreadsheet the updates were applied to.
tableRange
string 
optional
The range (in A1 notation) of the table that values are being appended to (before the values were appended). Empty if no table was found.
updates
object (UpdateValuesResponse) 
optional
Information about the updates that were applied.
spreadsheetId
string 
optional
The spreadsheet the updates were applied to.
updatedCells
integer <int32>
optional
The number of cells updated.
updatedColumns
integer <int32>
optional
The number of columns where at least one cell in the column was updated.
updatedData
object (ValueRange) 
optional
The values of the cells after updates were applied. This is only included if the request's includeValuesInResponse field was true.
updatedRange
string 
optional
The range (in A1 notation) that updates were applied to.
updatedRows
integer <int32>
optional
The number of rows where at least one cell in the row was updated.
Previous
/v4/spreadsheets/{spreadsheetId}/values/{range}
Next
/v4/spreadsheets/{spreadsheetId}/values/{range}:clear
Built with