Google Sheets Export — append, replace, upsert (no OAuth)
Pricing
from $5.00 / 1,000 export runs
Google Sheets Export — append, replace, upsert (no OAuth)
Writes Apify dataset rows or your own JSON rows into a Google Sheet by appending, replacing or upserting. Uses a Google service account instead of OAuth, so it works from integrations, schedules and AI agents. Clear error messages, cell-limit check before writing.
Pricing
from $5.00 / 1,000 export runs
Rating
0.0
(0)
Developer
도영 김
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
8 days ago
Last modified
Categories
Features
Share
What does Google Sheets Export do?
It writes rows into a Google Sheet: from any Apify dataset, from an integration attached to another Actor, or from JSON you pass in. You choose how: append, replace or upsert.
It was built around the things that usually go wrong when you export to Sheets:
- No OAuth and no setup. It signs in with a Google service account: share your sheet with one email address and run. There is no browser consent screen to complete. It runs unattended from schedules, integrations, the API and AI agents (MCP).
- Any valid spreadsheet ID is accepted. Paste the full URL or the bare ID. IDs are not required to be a fixed length.
- Append really appends. Existing rows are never touched. New rows go after the last non-empty row.
- Errors say what to do. "Share the spreadsheet with
name@project.iam.gserviceaccount.comas Editor", "spreadsheet ID is wrong or not shared", "enable the Sheets API in project X" — not a stack trace. - Limits are checked before writing. If the result would exceed Google's cell limit, nothing is written and the message gives the current cells, the cells to add and the limit.
- Failures are retried. Rate limits (429) and server errors (5xx) are retried with exponential backoff and jitter, honouring
Retry-After.
Quick start — one step, no Google Cloud setup
Share your spreadsheet with this address as Editor:
sheets-export@sheets-export-actor.iam.gserviceaccount.com
Open the sheet, click Share, paste the address, choose Editor, click Send. Then paste the spreadsheet URL into the Actor and run it. Leave the Service account key field empty.
If the sheet is not shared, the run fails with: Google denied access. Share the spreadsheet with <email> as Editor ... — and nothing else happens.
This shared service account can open only spreadsheets that someone has explicitly shared with it. It is used by everyone who runs this Actor without their own key, and its Google API quota (300 requests per minute) is shared too.
Prefer your own service account? (about 5 minutes, once)
Use your own if you want your own quota, or do not want to share a sheet with an account you do not control.
- In Google Cloud Console create or pick a project, then open APIs & Services > Library, search Google Sheets API and click Enable.
- Open IAM & Admin > Service accounts > Create service account. Give it any name. No roles are needed.
- Open the new service account, go to Keys > Add key > Create new key > JSON. A
.jsonfile downloads. - Share your spreadsheet with that service account's email address (it ends in
.iam.gserviceaccount.com) as Editor. - Paste the whole contents of the JSON file into the Actor's Service account key field. Your own key always takes priority over the shared account.
Modes
Header row is row 1. Existing columns are never reordered or renamed. Columns in your data that the sheet lacks are added at the right end. Sheet columns missing from your data stay blank for new rows.
append (default). Sheet has name | age, you send {name: "Cy", age: 5}:
| Before | After |
|---|---|
| Ann, 30 | Ann, 30 |
| Bob, 40 | Bob, 40 |
| Cy, 5 |
replace. Clears the tab, then writes header and rows. If the source is empty, the sheet is left untouched.
| Before | After (sent {n: "only"}) |
|---|---|
| name, age / Ann, 30 / Bob, 40 | n / only |
upsert with keyFields: ["id"]. A row whose key matches an existing row overwrites that row in place (only the columns you send; other sheet columns keep their values). Others are appended. Keys are compared as trimmed text.
| Before | Sent | After |
|---|---|---|
| 1, Ann / 2, Bob | {id: 2, name: "Bobby"}, {id: 3, name: "Cy"} | 1, Ann / 2, Bobby / 3, Cy |
Input
| Field | Notes |
|---|---|
spreadsheet | Full URL or ID. A gid= in the URL selects that tab. |
sheetName | Tab title. Created if missing. Default: the gid tab, else the first tab. |
mode | append (default), replace, upsert. |
keyFields | Required for upsert. |
datasetId / rows | Source. First present wins: datasetId, then integration payload, then rows. |
fields | Column selection and order. Default: all keys, first-seen order. |
flatten | Default on. Nested objects become a.b.c columns; lists of text/numbers are joined with , ; lists of objects become JSON text. |
dedupeFields | Drop repeats of earlier source rows; in append mode also skip rows already in the sheet. |
valueInputOption | RAW (default) or USER_ENTERED. |
maxRows | Stop after this many source rows. |
serviceAccountKey | Secret. Full JSON key. |
RAW vs USER_ENTERED. With RAW (default) every value is stored exactly as given. Text that starts with =, +, - or @ stays literal text, so scraped data cannot inject formulas. Use USER_ENTERED only if you want formulas to run and dates/numbers to be parsed as if typed.
Use as an integration after any scraper
Open the Actor you want to export, go to Integrations > Add integration > this Actor, then:
- Set Dataset to
{{resource.defaultDatasetId}}— this passes the finished run's dataset and gives this Actor permission to read it. - Set the spreadsheet URL (shared with the service account as Editor).
- Optionally set
mode: upsertandkeyFieldsto keep one row per item across scheduled runs.
The Dataset field matters: this Actor runs with limited permissions and can read only a dataset that arrives through that field. To export an existing dataset by hand, pick it in the same field.
Use from AI agents / MCP
Because there is no interactive login, an agent can call it directly. Minimal input:
{"spreadsheet": "https://docs.google.com/spreadsheets/d/<ID>/edit","sheetName": "Agent output","rows": [{ "id": 1, "summary": "..." }],"serviceAccountKey": "<JSON key>"}
The result is in the run's OUTPUT record and as one dataset item: spreadsheetUrl, sheetName, mode, rowsRead, rowsWritten, rowsUpdated, rowsSkippedDuplicate, columnsAdded, cellsTruncated, durationMs. On failure the same OUTPUT record holds { error, code } and the run fails with the same human message.
Pricing
Pay per event: one export-run event per successful export, plus one rows-1000 event per started 1,000 rows written or updated. Nothing is charged if the run fails or writes no rows. See the pricing tab for current prices.
Limits (checked against Google's documentation on 2026-11-12)
- Cells per spreadsheet: 20 million (Google Docs Editors Help). The count includes the whole grid of every tab, including empty cells. The Actor stops before writing if the run would pass it.
- Characters per cell: 50,000 (confirmed against the live API on 2026-11-12: 50,000 accepted, 50,001 rejected). Longer values are truncated and counted in
cellsTruncated; the run does not fail. - API quota: 60 write and 60 read requests per minute per user, 300 per project (Sheets API limits). Google recommends payloads of about 2 MB at most; the Actor writes in batches below that and retries on 429.
- The Actor reads the target tab once before appending or upserting (to find the last row and existing keys). Very large tabs make that read slow.
- Empty source: nothing is written and nothing is cleared, even in replace mode.
FAQ
Do I need to log in to Google? No. You share your sheet with the service account's address — that is the whole setup.
Who can see my data? A service account can read and write only spreadsheets that someone has explicitly shared with its email address. It has no access to the rest of your Drive. With the shared account, the Actor reads the target tab (to find the last row and, for upsert or dedupe, existing keys) and writes your rows; it does not store, copy or log cell contents. Un-share the sheet at any time to end access. If you supply your own key, it is a secret input, is never logged, and is used only to request a short-lived Google access token.
Shared account or my own? The shared one needs no setup. Use your own for a private quota or stricter control. Your own key always takes priority.
My spreadsheet ID is not 44 characters. That is fine. Any ID of 20 or more letters, digits, - and _ is accepted.
Why does the run say "not shared"? Observed live (2026-11-12): a wrong ID gives HTTP 404 "Requested entity was not found"; a spreadsheet the service account may not edit gives HTTP 403 "The caller does not have permission". The Actor maps 404 to "ID wrong or not shared" and 403 to "share it with
Does it keep my formatting? Append and upsert leave existing cells and formatting alone. Replace clears values only, not formatting.