Google Sheets Sync - Reliable Export, Append & Upsert avatar

Google Sheets Sync - Reliable Export, Append & Upsert

Pricing

from $0.08 / 1,000 row writtens

Go to Apify Store
Google Sheets Sync - Reliable Export, Append & Upsert

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

Ashish Agarwal

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

8 hours ago

Last modified

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/url already 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.city columns, 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

  1. Create a Google service account (one-time, ~5 minutes – see below) and copy its JSON key.
  2. Share your spreadsheet with the service account's email (...@...iam.gserviceaccount.com) as Editor.
  3. Run the Actor with:
    • Spreadsheet URL or ID
    • Mode: append, replace, upsert or read
    • 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)

  1. Open Google Cloud Console and create a project (any name).
  2. APIs & Services → Library → enable Google Sheets API.
  3. APIs & Services → Credentials → Create credentials → Service account. Name it, skip optional steps.
  4. Open the service account → Keys → Add key → Create new key → JSON. A .json file downloads.
  5. Paste the whole file content into the Google service account key field.
  6. 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

FieldWhat it does
spreadsheetURL or ID of the spreadsheet
sheetNameTab name; created if missing (default Sheet1)
modeappend (default), replace, upsert, read
datasetId / jsonData / dataUrlWhere the rows come from (write modes)
matchColumnField used to match rows in upsert (keyColumn still works)
columnsColumns to place first, in this order
onlySelectedColumnsWrite only the listed columns
flattenModedot (default) or json for nested data
parseValuesOn: Sheets interprets numbers/dates/formulas (USER_ENTERED). Off: values stored as-is (RAW)

Output

  • Write modes: a summary in the OUTPUT record 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 demo summary item plus up to 100 preview rows 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.

EventFree planBronzeSilverGold 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

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.