Google Sheets Sync - Reliable Export, Append & Upsert
Pricing
from $0.08 / 1,000 row writtens
Google Sheets Sync - Reliable Export, Append & Upsert
Send Apify datasets, JSON or CSV to Google Sheets without failed runs: true append (no full-sheet rewrite), upsert by key, auto-flatten nested data, quota-aware retries. Also reads sheets into a dataset.
Pricing
from $0.08 / 1,000 row writtens
Rating
0.0
(0)
Developer
Ashish Agarwal
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
8 hours ago
Last modified
Categories
Share
Google Sheets Sync – Reliable Export, Append & Upsert
Send any Apify dataset, JSON or CSV to Google Sheets – without failed runs. Built for scheduled scrapers and integrations that push data after every run.
- True append – new rows go below your data. The sheet is not rewritten on every run, so existing rows, columns, formulas and formatting stay put and big sheets stay fast.
- Upsert by key – update rows whose
id/urlalready exists, append the rest. Perfect for price trackers and monitoring. - Quota-aware – Google allows ~60 write requests per minute per user. When it pushes back (HTTP 429) the Actor waits and retries instead of failing and importing nothing.
- Nested data handled – objects become
address.citycolumns, simple lists become comma-separated text, complex lists become JSON. No "arrays cannot contain nested structures" errors. - Large datasets – rows are sent in batches sized to Google's request limits; a clear error appears before writing if a spreadsheet would pass the 10 million-cell limit.
- Read mode – load any tab into a dataset (header row → field names) to feed other Actors.
How to use it
- Create a Google service account (one-time, ~5 minutes – see below) and copy its JSON key.
- Share your spreadsheet with the service account's email (
...@...iam.gserviceaccount.com) as Editor. - Run the Actor with:
- Spreadsheet URL or ID
- Mode:
append,replace,upsertorread - Service account key (stored encrypted as a secret input)
- Data source: an Apify dataset ID, inline JSON, or a JSON/CSV URL
Try it first for free: run it without a spreadsheet and key. Nothing is written and nothing is charged; the dataset shows the exact columns and rows your data would get (nested fields flattened), so you can check the layout before setup.
After another Actor (integration)
In the other Actor's Integrations tab → Connect Actor or Task → choose Google Sheets Sync and set:
{"spreadsheet": "https://docs.google.com/spreadsheets/d/<id>/edit","sheetName": "Results","mode": "append","datasetId": "{{resource.defaultDatasetId}}"}
Every finished run then lands in your sheet automatically.
Upsert example (price tracker)
{"spreadsheet": "<id>","sheetName": "Prices","mode": "upsert","matchColumn": "url","datasetId": "{{resource.defaultDatasetId}}"}
From n8n, Make or any app (one HTTP call)
Save the spreadsheet and the service-account key once in a Task (this Actor → Create task), so your workflows never carry the key. Then send rows from anywhere:
POST https://api.apify.com/v2/actor-tasks/<your-task-id>/run-sync-get-dataset-items- Header
Authorization: Bearer <your Apify API token> - JSON body – only what changes per call; everything you leave out comes from the task:
{ "mode": "upsert", "matchColumn": "email", "jsonData": [{ "email": "ana@example.com", "status": "won", "value": 1200 }] }
Typical uses: the last step of an n8n or Make workflow that collects leads or prices, or a place where an AI agent's results land so people can review them in a sheet.
Create a service account (one-time)
- Open Google Cloud Console and create a project (any name).
- APIs & Services → Library → enable Google Sheets API.
- APIs & Services → Credentials → Create credentials → Service account. Name it, skip optional steps.
- Open the service account → Keys → Add key → Create new key → JSON. A
.jsonfile downloads. - Paste the whole file content into the Google service account key field.
- Share each spreadsheet you want to use with the service account email (shown in the JSON as
client_email) as Editor.
Your key never leaves your Apify account: it is a secret input, encrypted at rest and hidden in logs. You can revoke it any time in Google Cloud.
Input options
| Field | What it does |
|---|---|
spreadsheet | URL or ID of the spreadsheet |
sheetName | Tab name; created if missing (default Sheet1) |
mode | append (default), replace, upsert, read |
datasetId / jsonData / dataUrl | Where the rows come from (write modes) |
matchColumn | Field used to match rows in upsert (keyColumn still works) |
columns | Columns to place first, in this order |
onlySelectedColumns | Write only the listed columns |
flattenMode | dot (default) or json for nested data |
parseValues | On: Sheets interprets numbers/dates/formulas (USER_ENTERED). Off: values stored as-is (RAW) |
Output
- Write modes: a summary in the
OUTPUTrecord and the dataset – rows written, final column list, spreadsheet link. - Read mode: every row of the tab in the dataset, keyed by the header row.
- Preview (no spreadsheet or key): one
demosummary item plus up to 100previewrows exactly as they would be written; free.
Pricing
Pay per event: you pay per row written or read. Higher Apify plans get a Store discount automatically.
| Event | Free plan | Bronze | Silver | Gold and up |
|---|---|---|---|---|
| Row written | $0.00010 | $0.000095 | $0.000088 | $0.00008 |
| Row read | $0.00010 | $0.000095 | $0.000088 | $0.00008 |
1,000 rows ≈ $0.10 · 100,000 rows ≈ $10 on the Free plan ($8 on Gold). Header rows and preview runs are free, failed runs that write nothing cost nothing, and Max cost per run caps any run.
Works great with
- Google Trends Scraper – Bulk Keywords & Comparable Scores: add this Actor as its integration to get every Trends run in a sheet automatically.
FAQ
Why a service account instead of "Sign in with Google"? It's more reliable for automation: no expiring sign-in tokens, its own API quota, and it only touches spreadsheets you explicitly share with it.
Will append move my existing columns? No. Existing columns keep their position; new fields are added as new columns on the right.
What happens on Google's rate limit? The Actor waits (exponential backoff, up to ~1 minute) and retries the same batch. You get your data instead of a failed run.
Can I write to a sheet with formulas or formatting? Yes. Append and upsert only write the cells they need.
Support
Open an issue on the Issues tab – fixes usually ship within a few days.