Dataset → Google Sheets Incremental Sync avatar

Dataset → Google Sheets Incremental Sync

Pricing

from $0.05 / 1,000 successfully synchronized rows

Go to Apify Store
Dataset → Google Sheets Incremental Sync

Dataset → Google Sheets Incremental Sync

Sync Apify Dataset rows to Google Sheets and automatically remember the last synced Dataset offset. Also supports append, replace, and upsert.

Pricing

from $0.05 / 1,000 successfully synchronized rows

Rating

0.0

(0)

Developer

Starshape Tools

Starshape Tools

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

a month ago

Last modified

Categories

Features

Limited permissions

Share

Sync an Apify Dataset to Google Sheets without manually tracking offsets.

The recommended mode remembers the last successfully synced Dataset offset in a persistent Apify Key-Value Store. Schedule the Actor every hour, every day, or after your scraper finishes, and only new Dataset items are appended.

What problem does it solve?

Typical workflow:

Scraper → Apify Dataset → Google Sheets

A normal append workflow can duplicate old rows on every scheduled run. This Actor keeps a checkpoint and only reads items after the previous successful sync.

Run 1: Dataset items 0–999 → Sheets → checkpoint = 1000
Run 2: Dataset items 1000–1049 → Sheets → checkpoint = 1050
Run 3: no new items → no write

The checkpoint moves only after the Google Sheets write succeeds and any active synchronized-row billing is successfully accounted for.

Features

  • Incremental Dataset → Google Sheets sync
  • Automatic persistent offset checkpoint
  • No manual offset management
  • Append, replace, and upsert one-shot modes
  • Google Service Account authentication
  • Retry with exponential backoff for Google 429/5xx
  • RAW writes to avoid interpreting incoming strings as formulas
  • Dry-run validation
  • Configurable batch and row limits
  • Machine-readable run summary, including row-billing state
  • Pay-per-event billing aligned to successfully synchronized incoming rows
  • Deterministic, credential-free safe sample mode

Safe sample mode

Set mode to sample (the example-run default) to exercise the real row normalization, column inference, object-cell serialization, and table-planning logic. This path makes no Google HTTP requests, opens no source Dataset, and reads or writes no checkpoint store. It emits a representative Dataset item and OUTPUT summary with status: SAMPLE_COMPLETE. It charges zero synchronized-row events.

Set mode to live for normal synchronization. Live mode still requires spreadsheet and serviceAccountJson; these requirements are enforced before any Google request.

Billing and spending limits

The primary paid event is synchronized-row: one incoming source row successfully synchronized to the target Google Sheet.

  • Safe sample mode, dry-run, and no-new-row runs charge zero synchronized rows.
  • A row is charged only after the Google Sheets mutation succeeds. Failed Google writes are not charged.
  • Append and Replace charge the incoming source rows accepted by that run.
  • Upsert charges only the incoming source rows, not old Sheet rows that are rewritten internally.
  • One-shot Append / Replace / Upsert checks the remaining run charge budget before mutation. If the whole operation is not affordable, the Sheet is not partially changed and the run returns CHARGE_LIMIT_REACHED.
  • Incremental append may process only the affordable prefix. Its checkpoint advances only after those rows are both written and successfully charged.
  • During a pricing migration, custom row billing activates only when the active run pricing actually contains the synchronized-row event, so a newly deployed build does not emit an unknown event against the previous pricing configuration.

1. Create a Google Service Account

In Google Cloud:

  1. Create/select a project.
  2. Enable Google Sheets API.
  3. Create a Service Account.
  4. Create a JSON key.
  5. Copy the Service Account client_email.

2. Share the spreadsheet

Share the target Google Sheet with the Service Account client_email as Editor.

3. Run incremental sync

Set:

  • operation: incremental_append
  • sourceDatasetId: your Apify Dataset
  • spreadsheet: target Sheet URL or ID
  • sheetName: target tab
  • serviceAccountJson: Service Account JSON

The first successful run starts at offset 0. Later runs continue from the stored offset automatically.

Resetting the checkpoint

Set resetCheckpoint to true for one run.

This restarts incremental sync from Dataset offset 0.

Warning: restarting from zero can intentionally append duplicates if your sheet already contains those rows.

Checkpoint identity

By default, the Actor derives a checkpoint from:

sourceDatasetId + spreadsheetId + sheetName

Use syncKey if you need an explicit stable checkpoint identifier.

Other modes

Append

Adds all incoming rows.

Replace

Clears values from the target tab and writes the incoming table again.

Upsert

Merges rows by keyColumn.

For complex spreadsheets with formulas inside the data grid, use Incremental append instead of Replace/Upsert.

Input source

Incremental append requires an Apify Dataset.

Append, Replace, and Upsert can use either:

  • sourceDatasetId, or
  • inline rows.

Privacy

The Google Service Account credential is a secret Actor input. Do not put credentials into the README, issues, logs, or sample outputs.

The published preview Task uses exactly { "mode": "sample" }. It contains no service-account JSON, spreadsheet identifier, source Dataset ID, sync key, checkpoint-store override, inline rows, or other writable production resource.

Limitations

  • The target spreadsheet and tab must already exist.
  • Do not run two incremental syncs for the exact same checkpoint concurrently; concurrent runs can append duplicate rows.
  • Upsert rewrites the tab's data grid and is intended for plain data tables.
  • Google Sheets API quotas still apply.
  • This Actor does not create or manage Google Cloud credentials for you.

Suggested automation

Create an Apify Task with your saved input, then add a schedule.

Scraper runs
↓
Dataset grows
↓
Scheduled Incremental Sync
↓
Only new rows reach Google Sheets

Output

Each run writes a summary with:

  • source offset
  • next offset
  • source row count
  • rows written
  • target sheet
  • duration
  • synchronized rows charged
  • billing event / billing-active state
  • whether the run stopped at the charge limit
  • status

Statuses include:

  • SYNC_COMPLETE
  • NO_NEW_ROWS
  • DRY_RUN_OK
  • CHARGE_LIMIT_REACHED