Google Sheets Import & Export | CSV, JSON, Upsert, No OAuth avatar

Google Sheets Import & Export | CSV, JSON, Upsert, No OAuth

Pricing

$0.20 / 1,000 row writtens

Go to Apify Store
Google Sheets Import & Export | CSV, JSON, Upsert, No OAuth

Google Sheets Import & Export | CSV, JSON, Upsert, No OAuth

Export any Apify dataset, CSV or JSON file (URL) to Google Sheets: append, append only new rows, upsert/update rows by key, or replace. Import a Google Sheet into a dataset for free. No OAuth, no Google Cloud: public link, Apps Script or service account. Quota-safe retries, exact text.

Pricing

$0.20 / 1,000 row writtens

Rating

0.0

(0)

Developer

Mikirag3

Mikirag3

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Features

Limited permissions

Share

Google Sheets Import & Export — datasets, CSV and JSON files to Google Sheets and back, with upsert

Export the results of any Actor, a CSV or JSON file from a URL, or pasted CSV/JSON to a Google Sheet, or import a Google Sheet into a dataset — without OAuth and without a Google Cloud project. Built for scheduled pipelines: it does not fail on Google's write quota, it never wipes your sheet by accident, and it keeps your data exactly as scraped.

  • Import a sheet in 10 seconds, free: paste the link of a sheet shared as "Anyone with the link" and get one dataset item per row (first row = field names). Private sheets work too, with the same Apps Script or service account used for export. Feed a list of URLs, keywords or products from a sheet into any other Actor.
  • CSV / JSON file to Google Sheets on a schedule: point it at a public CSV, TSV, JSON or JSON Lines link (product feed, report export, open data, a file on GitHub, Dropbox or Google Drive) and the sheet is refreshed on every run — delimiter and encoding detected, cells kept exactly as in the file. Combine with upsert for a feed that updates rows in place
  • 4 export modes: append all rows · append only new rows (skips items whose key is already in the sheet) · upsert / update rows by key (existing rows updated in place, new ones appended) · replace the tab
  • Upsert keeps your own columns: only the fields an item has are written, so notes, statuses or formulas you add in extra columns next to the data are never overwritten
  • Never fails on quota: batched writes, automatic retries with back-off on Google's "too many requests" and temporary errors
  • Exact text: 00123 keeps its zeros, dates stay as written, =HYPERLINK(...) in scraped data is never executed (formula-injection safe)
  • Columns that follow your data: nested JSON flattened to price.value, new fields added as new columns at the right, existing column order kept
  • Safe replace: the tab is cleared only after the first data has been read — an empty or failed source never leaves you with an empty sheet
  • Large exports: streamed in pages, no size limit on the input dataset; stops cleanly with a clear message before Google's 10 million cells per spreadsheet
  • Free preview: run it without a Google connection to see exactly how your rows will look

Quick start (Apps Script, about 2 minutes, once per spreadsheet)

  1. Open your Google Sheet → Extensions → Apps Script. Delete what's there and paste the script below.
  2. Change SECRET to a long password of your choice. Save (💾).
  3. Deploy → New deployment → gear icon → Web app. Execute as: Me. Who has access: Anyone. Deploy and authorize with your Google account.
  4. Copy the Web app URL (https://script.google.com/macros/s/…/exec).
  5. In this Actor: pick the dataset, paste the URL and the same secret, Start.

The script only works on the spreadsheet it is attached to and only answers requests carrying your secret. "Anyone" is required so the Actor can call it without logging in as you; the secret is what protects it. To stop access at any time: Deploy → Manage deployments → Archive.

CSV or JSON file to Google Sheets (scheduled sync)

No dataset needed: give a public link and the file is downloaded and written to the sheet on every run.

{
"fileUrl": "https://example.com/exports/products.csv",
"authMethod": "appsScript",
"appsScriptUrl": "https://script.google.com/macros/s/…/exec",
"appsScriptSecret": "your-secret",
"sheetName": "Products",
"mode": "upsert",
"dedupeKey": "sku"
}
  • Formats: CSV/TSV (comma, semicolon, tab or pipe, detected automatically; UTF-8 or Excel's Windows encoding), JSON (an array of objects, or an object with an items/data/results array — e.g. most REST API responses) and JSON Lines. Up to 50 MB per file.
  • Share links work as they are: GitHub blob links, Dropbox ?dl=0, Google Drive file links and Google Sheets links (another spreadsheet's tab as CSV) are turned into direct downloads.
  • Exact cells: CSV values stay text as written (00123, 2026-01-31, 1,5); nested JSON is flattened to price.value columns.
  • Paste instead of a link: put CSV text in …or paste CSV for a one-off import.
  • Schedule it (Apify Console → Schedules) with upsert or append-new and the sheet mirrors the feed: changed rows updated in place, new rows added, your own extra columns untouched.

Run it without a Google connection first to preview the first 100 rows for free.

Import a Google Sheet into a dataset

Public sheet (no setup): in Google Sheets, Share → General access → Anyone with the link (Viewer). Open the tab you want, copy the URL from the browser, then run:

{
"operation": "import",
"authMethod": "public",
"spreadsheet": "https://docs.google.com/spreadsheets/d/…/edit#gid=0"
}

Private sheet: use the same Apps Script bridge (version 2 or later of the script above; if you installed version 1, paste the new one and Deploy → Manage deployments → Edit → New version) or a service account with Viewer access, and set "operation": "import" plus "sheetName" if it is not the first tab.

Each non-empty row becomes an item, keyed by the header row (empty names become column3, repeated ones name_2). Cells come as text exactly as shown in the sheet (00123 keeps its zeros); turn on Convert numbers and TRUE/FALSE to get numbers and booleans. Optional: a range (A1:F500), only some columns, skip/limit rows.

Typical use: keep your input list (start URLs, search terms, product IDs, companies to watch) in a sheet your team edits, import it at the start of a scheduled workflow and pass the dataset to the next Actor.

Upsert: keep one row per item, always up to date

Mode upsert with a Key field (e.g. url, sku, id, nested product.sku):

  • an item whose key is already in the sheet updates that row in place (same row number, so filters, colors and links to the row keep working);
  • an item with a new key is appended at the bottom;
  • only the fields the item contains are written: columns you added by hand (notes, owner, status, formulas) are left untouched, and so are fields missing from the item;
  • if a key appears twice in the run, the first item wins (the others count as duplicates, free).

Typical uses: a price tracker where each product keeps its row and the price column changes, a job or lead list where the status column is yours, a stock or ranking monitor. Upsert needs version 3 of the bridge script (above): if you installed an older one, paste the new script and Deploy → Manage deployments → Edit → New version (URL and secret stay the same). With a service account nothing changes. Don't sort or delete rows of that tab while a run is writing to it.

Alternative: service account (teams, automation)

  1. In Google Cloud Console create a project, enable the Google Sheets API, create a service account and download a JSON key.
  2. Share your spreadsheet with the service account's client_email as Editor.
  3. In this Actor choose Service account key, paste the whole JSON key (stored encrypted) and the spreadsheet URL. (For import only, Viewer access is enough.)

Send every run of another Actor to Sheets automatically

On the Actor whose results you want in Sheets: Integrations → Connect Actor or task → Google Sheets Import & Export, and set the input to:

{
"datasetId": "{{resource.defaultDatasetId}}",
"authMethod": "appsScript",
"appsScriptUrl": "https://script.google.com/macros/s/…/exec",
"appsScriptSecret": "your-secret",
"mode": "append-new",
"dedupeKey": "url"
}

Each time that Actor finishes, only the new items land in your sheet. Use "mode": "upsert" instead to also refresh the rows already there (prices, stock, status). Pair it with a schedule for a self-updating spreadsheet (price trackers, job lists, lead lists, monitoring).

Use it from the API

curl -X POST "https://api.apify.com/v2/acts/mikirag3~google-sheets-export/run-sync-get-dataset-items?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"rawData":[{"name":"Ada","score":10}],"appsScriptUrl":"https://script.google.com/macros/s/…/exec","appsScriptSecret":"your-secret"}'

Input

FieldWhat it does
Operationexport (default) or import.
Dataset to exportAny dataset you can access (e.g. another run's results). Or a CSV / JSON file URL, pasted CSV, or raw JSON instead.
File format · CSV delimiterFor a file URL or pasted CSV: detected automatically, override if needed.
How to connectApps Script web app (recommended) · service-account key · public link (import only).
Tab nameExport: created if missing. Import: tab to read. Empty = first tab.
Modeappend · append-new or upsert (with Key field, e.g. url, nested product.sku) · replace.
ColumnsOptional: only these fields, in this order.
Arraysjoin (a, b, c in one cell) · json · columns (tags.0, tags.1…).
Let Google convert textOff by default (exact text). On = like typing in the cell: numbers, dates and formulas are interpreted.
Range · First row is the header · Convert numbersImport options (see above).
Skip first / Maximum itemsExport or import a slice.

Output

Import: the dataset holds one item per row; the summary (rowsImported, emptyRowsSkipped, columns, sheet and spreadsheet) is in the key-value store as OUTPUT.

Export: the run summary (also in the key-value store as OUTPUT):

{
"status": "ok",
"rowsWritten": 1250,
"rowsUpdated": 0,
"skippedDuplicates": 318,
"mode": "append-new",
"sheet": "Leads",
"spreadsheetName": "My leads",
"spreadsheetUrl": "https://docs.google.com/spreadsheets/d/…",
"columns": ["name", "url", "price.value"]
}

Pricing

Export: $0.20 per 1,000 rows written (new or updated in upsert mode) — no start fee, preview runs free, duplicates skipped in append-new/upsert mode are free. Import: free, up to 5,000 rows per run (use Skip first items to read the next 5,000 in another run). Set a maximum cost per run in the run options: the Actor stops cleanly at that limit and never writes rows it cannot charge.

Limits (Google's, not ours)

  • 10 million cells per spreadsheet (all tabs together) — the Actor stops before exceeding it and tells you where.
  • 50,000 characters per cell — longer texts are truncated with …[truncated].
  • Apps Script: up to 6 minutes per call; the Actor sends batches of up to 5,000 rows, so any size of export works.

FAQ

Why an Apps Script instead of "Connect Google account"? The bridge runs inside your own spreadsheet: no Google Cloud project, no OAuth token that expires or gets revoked, and you can switch it off any time from Manage deployments.

Can I send a CSV file to Google Sheets every day? Yes: put the CSV link in File URL, choose upsert (with a key column) or replace, and add a schedule. The file is downloaded fresh on every run; rows are charged only when written or updated.

Can I read a sheet without sharing it publicly? Yes: use the Apps Script bridge (it reads only the spreadsheet it is attached to) or a service account with Viewer access.

Is my data stored anywhere? No. Exported rows go from the dataset straight to your spreadsheet; imported rows go only to your run's dataset. Secrets and keys are stored encrypted by Apify.

A run failed — what now? The status message says exactly what to fix (wrong secret, deployment not set to "Anyone", sheet not shared with the service account…). Quota and temporary Google errors are retried automatically, and with the Apps Script method a retried batch is not written twice.

Found a bug or need a feature? Open an issue on the Actor page.