Export to Google Sheets: batched, retried, clear errors
Pricing
$5.00 / 1,000 export completeds
Export to Google Sheets: batched, retried, clear errors
Exports an Apify dataset or a JSON list to a Google Sheets tab, within Google's quotas, with retries and actionable error messages. Authenticates with a service account, so no interactive login is needed.
Pricing
$5.00 / 1,000 export completeds
Rating
0.0
(0)
Developer
Datos Fiables
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
20 days ago
Last modified
Categories
Features
Share
Send an Apify dataset or a JSON list to a Google Sheets tab, without hitting Google's quotas and without an interactive Google login.
- Batched writes with a minimum gap between requests, to stay under Google's per-minute limit.
- Automatic retries on
429and5xxerrors, honouringRetry-After. - Service account authentication: works unattended, in schedules, integrations and AI agents.
- Checks before writing: the tab exists and the sheet stays under Google's 10 million cell limit.
- Clear errors: every failure returns a stable
codigo, amensajeand asolucionthat says how to fix it. - Values are written as-is (
RAW):00123stays00123,1-2is not turned into a date,=SUM()is not executed.
Pricing
$0.005 per completed export, plus a tiny amount of platform compute (default memory 512 MB). Runs that fail are not charged.
How to use it
- Create a service account key (free, one time):
- In Google Cloud Console create a project and enable the Google Sheets API.
- Go to IAM & Admin → Service accounts → Create service account, then Keys → Add key → JSON. A
.jsonfile is downloaded.
- Share your spreadsheet as Editor with the
client_emailfrom that file (it ends iniam.gserviceaccount.com). - Run the Actor with the spreadsheet URL, the contents of the JSON key and either a
datasetIdordata.
Tip: to export the results of another Actor automatically, add this Actor as an integration of that Actor and pass its default dataset ID.
Input
| Field | Type | Default | Description |
|---|---|---|---|
spreadsheetId | string | — | Spreadsheet URL or ID. Required. |
serviceAccountJson | string (secret) | — | Full JSON key of the service account. Required. |
datasetId | string | — | Apify dataset to export. Use this or data. |
data | array | — | List of JSON objects. Use this or datasetId. |
sheetName | string | first tab | Exact tab name. |
mode | append | replace | append | Add rows at the end, or clear the tab first. |
writeHeaders | boolean | true | Write column names if the tab is empty. |
maxRows | integer | 50000 | Maximum rows to export (up to 1,000,000). |
Example:
{"spreadsheetId": "https://docs.google.com/spreadsheets/d/YOUR_ID/edit","serviceAccountJson": "{ \"type\": \"service_account\", ... }","datasetId": "YOUR_DATASET_ID","sheetName": "Data","mode": "append"}
Output
One item in the default dataset per run.
Success:
{"estado": "ok","hoja": "My spreadsheet","pestana": "Data","modo": "append","filasEscritas": 1200,"cabecerasEscritas": true,"columnas": ["name", "age", "city"],"lotes": 1,"avisos": [],"peticionesAGoogle": 3,"reintentos": 0,"fuente": "https://docs.google.com/spreadsheets/d/YOUR_ID/edit#gid=0","actualizado": "2026-11-02T10:00:00.000Z"}
Error (the run is marked as failed and is not charged):
{"estado": "error","codigo": "SIN_PERMISOS","mensaje": "Google denegó el acceso a la hoja (403).","solucion": "Abre la hoja, pulsa Compartir y añade el email de la cuenta de servicio (campo client_email) como Editor. ...","actualizado": "2026-11-02T10:00:00.000Z","fuente": "https://developers.google.com/workspace/sheets/api/limits"}
Field names are in Spanish and stable, so agents and integrations can rely on them. mensaje and solucion are currently in Spanish; the codigo table below explains each one in English.
Error codes
codigo | Meaning |
|---|---|
ENTRADA_INVALIDA | Missing or wrong input (e.g. both datasetId and data). |
CREDENCIALES_INVALIDAS | The service account JSON is malformed. |
AUTENTICACION_FALLIDA | Google rejected the key (deleted key or Sheets API not enabled). |
SIN_PERMISOS | The spreadsheet is not shared with the service account. |
HOJA_NO_ENCONTRADA | Wrong spreadsheet URL or ID. |
PESTANA_NO_ENCONTRADA | No tab with that name. |
DATASET_NO_ENCONTRADO | No dataset with that ID or name in your account. |
SIN_DATOS | Nothing to export. |
LIMITE_CELDAS | The export would exceed Google's 10M cell limit. |
CUOTA_SUPERADA | Google's quota was still exceeded after retries. |
ERROR_GOOGLE | Other error returned by Google. |
ERROR_INESPERADO | Anything else; retry, and report it with the run ID if it persists. |
Limitations
- Does not create spreadsheets or tabs, and does not format cells.
- Rows are loaded into memory: up to
maxRows(50,000 by default). replaceclears the tab before writing. If a later batch fails, the tab is left partially written (the error says so and how many rows were written).- An interrupted export is not resumed.
Privacy
Your data and key go only from Apify to Google's official Sheets API. The key is a secret input: it is stored encrypted and never logged.
Questions or bugs
Open an issue in the Issues tab of this Actor. Include the run ID.