Descripción general de la API de Hojas de cálculo de Google
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
La API de Hojas de cálculo de Google es una interfaz RESTful que te permite leer y modificar los datos de una hoja de cálculo. La API de Hojas de cálculo te permite hacer lo siguiente:
- Crear hojas de cálculo
- Leer y escribir valores de celdas de hojas de cálculo
- Actualiza el formato de la hoja de cálculo
- Administra Hojas conectadas
A continuación, se incluye una lista de términos comunes que se usan en la API de Sheets:
- Spreadsheet
Es el objeto principal de Hojas de cálculo de Google. Puede contener varios Sheets
, cada uno con información estructurada en Cells
. El recurso spreadsheets
representa una hoja de cálculo. Contiene un valor spreadsheetId
único.
- ID de la hoja de cálculo
- Es el identificador único de una hoja de cálculo. Es una cadena específica que contiene letras, números y algunos caracteres especiales que hacen referencia a una hoja de cálculo, y se puede derivar de la URL de la hoja de cálculo. Los IDs de las hojas de cálculo son estables, incluso si cambia el nombre de la hoja de cálculo.
https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit?gid=SHEET_ID#gid=SHEET_ID
- Hojas de cálculo
Es una página o pestaña dentro de una hoja de cálculo. El recurso Sheets
representa una hoja. Contiene un valor sheetId
numérico único y una hoja title
como parte del objeto SheetProperties
.
- ID de la hoja
- Es el identificador único de una hoja específica dentro de una hoja de cálculo. Es un número entero específico que contiene números que hacen referencia a una hoja y se puede derivar de la URL de la hoja de cálculo. Los IDs de hoja son estables, incluso si cambia el nombre de la hoja. Para ver un ejemplo, consulta ID de hoja de cálculo.
- Cell
Es un campo individual de texto o datos dentro de una hoja. Las celdas se organizan en filas y columnas, y se pueden agrupar como un rango de celdas. El recurso Cells
representa cada celda, pero no tiene un valor de ID único.
En cambio, las coordenadas de filas y columnas identifican las celdas.
- Notación A1
- Sintaxis que se usa para definir una celda o un rango de celdas con una cadena que contiene el nombre de la hoja más las coordenadas de las celdas inicial y final con letras de columna y números de fila. Este método es el más común y útil cuando se hace referencia a un rango absoluto de celdas.
Sheet1!A1:B2
hace referencia a todas las celdas de las dos primeras filas y columnas de la Hoja1.
Sheet1!A:A
hace referencia a todas las celdas de la primera columna de la Hoja1.
Sheet1!1:2
hace referencia a todas las celdas de las dos primeras filas de la Hoja1.
Sheet1!A5:A
hace referencia a todas las celdas de la primera columna de la hoja 1, a partir de la fila 5.
A1:B2
hace referencia a todas las celdas de las dos primeras filas y columnas de la primera hoja visible.
Sheet1
hace referencia a todas las celdas de la Hoja1.
'Jon's_Data'!A1:D5
hace referencia a todas las celdas de las primeras cinco filas y cuatro columnas de una hoja llamada "Jon's_Data".
'My Custom Sheet'!A:A
hace referencia a todas las celdas de la primera columna de una hoja llamada "Mi hoja personalizada".
'My Custom Sheet'
hace referencia a todas las celdas de "Mi hoja personalizada".
Se requieren comillas simples para los nombres de hojas con espacios o caracteres especiales.
Sugerencia: Cuando sea posible, usa nombres distintos para los objetos en tus hojas de cálculo. Por ejemplo, A1 (sin comillas) hace referencia a la celda A1 en la primera hoja visible. 'A1'
hace referencia a una hoja con el nombre A1. Del mismo modo, Hoja1 hace referencia a una hoja con el nombre Hoja1. Sin embargo, si hay un rango con nombre llamado "Hoja1", entonces Hoja1 se refiere al rango con nombre y 'Sheet1'
se refiere a la hoja.
- Notación R1C1
- Sintaxis que se usa para definir una celda o un rango de celdas con una cadena que contiene el nombre de la hoja más las coordenadas de la celda inicial y final con números de fila y columna. Este método es menos común que la notación A1, pero puede ser útil cuando se hace referencia a un rango de celdas en relación con la posición de una celda determinada.
Sheet1!R1C1:R2C2
hace referencia a las dos primeras celdas de las dos primeras filas de la Hoja1.
R1C1:R2C2
hace referencia a las dos primeras celdas de las dos primeras filas de la primera hoja visible.
Sheet1!R[3]C[1]
hace referencia a la celda que se encuentra tres filas más abajo y una columna a la derecha de la celda actual.
- Rango con nombre
- Celda o rango de celdas definidos con un nombre personalizado para simplificar las referencias en toda una aplicación. Un recurso
FilterView
representa un rango con nombre.
- Rango protegido
- Celda o rango de celdas definidos que no se pueden modificar. Un recurso
ProtectedRange
representa un rango protegido.
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-08-29 (UTC)
[null,null,["Última actualización: 2025-08-29 (UTC)"],[],[],null,["# Google Sheets API Overview\n\nThe Google Sheets API is a RESTful interface that lets you read and modify a\nspreadsheet's data. The Sheets API lets you:\n\n- Create spreadsheets\n- Read and write spreadsheet cell values\n- Update spreadsheet formatting\n- Manage Connected Sheets\n\nThe following is a list of common terms used in the Sheets API:\n\n*Spreadsheet*\n\n: The primary object in Google Sheets. It can contain multiple `Sheets`, each\n with structured information contained in `Cells`. The\n [`spreadsheets`](/workspace/sheets/api/reference/rest/v4/spreadsheets)\n resource represents a spreadsheet. It contains a unique `spreadsheetId`\n value.\n\n *Spreadsheet ID*\n : The unique identifier for a spreadsheet. It's a particular string\n containing letters, numbers, and some special characters that reference a\n spreadsheet and it can be derived from the spreadsheet's URL. Spreadsheet\n IDs are stable, even if the spreadsheet name changes. \n\n https://docs.google.com/spreadsheets/d/\u003cvar translate=\"no\"\u003eSPREADSHEET_ID\u003c/var\u003e/edit?gid=\u003cvar translate=\"no\"\u003eSHEET_ID\u003c/var\u003e#gid=\u003cvar translate=\"no\"\u003eSHEET_ID\u003c/var\u003e\n\n*Sheet*\n\n: A page or tab within a spreadsheet. The\n [`Sheets`](/workspace/sheets/api/reference/rest/v4/spreadsheets/sheets) resource\n represents a sheet. It contains a unique numeric `sheetId` value and sheet\n `title` as part of the\n [`SheetProperties`](/workspace/sheets/api/reference/rest/v4/spreadsheets/sheets#sheetproperties)\n object.\n\n *Sheet ID*\n : The unique identifier for a specific sheet within a spreadsheet. It's a\n particular integer containing numbers that reference a sheet and it can be\n derived from the spreadsheet's URL. Sheet IDs are stable, even if the sheet\n name changes. For an example, see [Spreadsheet ID](#spreadsheet-id).\n\n*Cell*\n\n: An individual field of text or data within a sheet. Cells are arranged in rows\n and columns, and can be grouped as a range of cells. The\n [`Cells`](/workspace/sheets/api/reference/rest/v4/spreadsheets/cells)\n resource represents each cell, but it doesn't have a unique ID value.\n Instead, row and column coordinates identify the cells.\n\n *A1 notation*\n : A syntax used to define a cell or range of cells with a string that\n contains the sheet name plus the starting and ending cell coordinates using\n column letters and row numbers. This method is the most common and useful\n when referencing an absolute range of cells.\n - `Sheet1!A1:B2` refers to all the cells in the first two rows and columns of Sheet1.\n - `Sheet1!A:A` refers to all the cells in the first column of Sheet1.\n - `Sheet1!1:2` refers to all the cells in the first two rows of Sheet1.\n - `Sheet1!A5:A` refers to all the cells of the first column of Sheet 1, from row 5 onward.\n - `A1:B2` refers to all the cells in the first two rows and columns of the first visible sheet.\n - `Sheet1` refers to all the cells in Sheet1.\n - `'Jon's_Data'!A1:D5` refers to all the cells in the first five rows and four columns of a sheet named \"Jon's_Data.\"\n - `'My Custom Sheet'!A:A` refers to all the cells in the first column of a sheet named \"My Custom Sheet.\"\n - `'My Custom Sheet'` refers to all the cells in \"My Custom Sheet\".\n\n Single quotes are required for sheet names with spaces or special characters.\n\n **Tip** : Where possible, use distinct names for objects in your spreadsheets. For example, A1 (without quotes) refers to cell A1 in the first visible sheet. `'A1'` refers to a sheet with the name A1. Similarly, Sheet1 refers to a sheet with the name Sheet1. However, if there's a named range titled \"Sheet1\", then Sheet1 refers to the named range and `'Sheet1'` refers to the sheet.\n\n *R1C1 notation*\n : A syntax used to define a cell or range of cells with a string that\n contains the sheet name plus the starting and ending cell coordinates using\n row numbers and column numbers. This method is less common than A1 notation,\n but can be useful when referencing a range of cells relative to a given\n cell's position.\n - `Sheet1!R1C1:R2C2` refers to the first two cells in the top two rows of Sheet1.\n - `R1C1:R2C2` refers to the first two cells in the top two rows of the first visible sheet.\n - `Sheet1!R[3]C[1]` refers to the cell that is three rows below and one column to the right of the current cell.\n\n *Named range*\n : A defined cell or range of cells with a custom name to simplify references\n throughout an application. A\n [`FilterView`](/workspace/sheets/api/reference/rest/v4/spreadsheets/sheets#filterview)\n resource represents a named range.\n\n *Protected range*\n : A defined cell or range of cells that cannot be modified. A\n [`ProtectedRange`](/workspace/sheets/api/reference/rest/v4/spreadsheets/sheets#protectedrange)\n resource represents a protected range.\n\nRelated topics\n--------------\n\n- To learn about developing with Google Workspace APIs, including handling\n authentication and authorization, refer to [Develop on\n Google Workspace](/workspace/guides/get-started).\n\n- To learn how to configure and run a Sheets API app, try the\n [JavaScript quickstart](/workspace/sheets/api/quickstart/js)."]]