Google Sheets Export & Import: Dataset to Sheet, No OAuth
Pricing
from $0.15 / 1,000 rows
Google Sheets Export & Import: Dataset to Sheet, No OAuth
Export an Apify dataset to Google Sheets (append under existing rows or replace a tab) or import a Google Sheet spreadsheet to JSON. Your own service account, no OAuth; public sheets import with no key. Failed rows are never charged.
Pricing
from $0.15 / 1,000 rows
Rating
0.0
(0)
Developer
Altronite
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
19 days ago
Last modified
Categories
Features
Share
Export an Apify dataset to Google Sheets, appending rows under your existing data or replacing a tab, or import a Google Sheet (any spreadsheet tab) into a dataset as JSON. It uses the official Google Sheets API with your own service account, or a public sheet's CSV export for imports without a key. No Google sign-in or OAuth consent screen: you share the sheet with your service account's email and can revoke access any time by unsharing it.
Failed rows are never charged. Append keeps your header order and puts new fields in new columns on the right.
Quick start
No setup needed for a first run: this imports 10 rows from Google's public sample spreadsheet into the run's dataset, with no key. Paste it into the Input tab's JSON view and click Start.
{"mode": "import","spreadsheet": "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit","sheetName": "Sheet1","maxRows": 10}
Each sheet row becomes one dataset item, keyed by the header cells (all values are text):
{ "Student Name": "Alexandra", "Gender": "Female", "Class Level": "4. Senior", "Home State": "CA", "Major": "English", "Extracurricular Activity": "Drama Club" }
To export a dataset to Google Sheets you need your own service account (see Setup below), then use the export examples in the next section.
Who it's for
- Scraper users who want results in a team sheet
- Growing logs (append) and rebuilt report tabs (replace)
- URL or keyword lists kept in a sheet and fed to other Actors
Export a dataset to Google Sheets, or import a sheet
Three modes cover it: export with append, export with replace, and import.
Export, append: adds rows under the existing data. Your header order is kept, and new fields become new columns on the right.
{"mode": "export","writeMode": "append","spreadsheet": "https://docs.google.com/spreadsheets/d/1EXAMPLE-SHEET-ID-000000000000000/edit","sheetName": "Leads","datasetId": "EXAMPLEdatasetId00","serviceAccountJson": "<paste the whole JSON key file>"}
Export, replace: clears the tab, then writes a fresh header and the rows. columns picks the fields and their order.
{"mode": "export","writeMode": "replace","spreadsheet": "1EXAMPLE_SHEET_ID_0000000000000000","sheetName": "Daily report","datasetId": "EXAMPLEdatasetId00","columns": ["title", "price", "address.city"],"serviceAccountJson": "<paste the whole JSON key file>"}
Import: reads a tab into this run's dataset. The first row is the header, and each row after it becomes one item.
{"mode": "import","spreadsheet": "1EXAMPLE_SHEET_ID_0000000000000000","sheetName": "Keywords","serviceAccountJson": "<paste the whole JSON key file>"}
Import a public sheet, no key needed: if the sheet is shared as "Anyone with the link can view", leave
serviceAccountJson empty and the Actor reads the tab through the sheet's CSV export. Run it with an empty
input and it imports Google's public sample sheet, so you can see the output shape first. Writing (export)
always needs a service account.
{"mode": "import","spreadsheet": "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit","maxRows": 10}
Send one scraper run's results to a sheet: pick that run's dataset in the Dataset field, or pass its ID as datasetId through the API.
Test the connection first: a dry run plans the export without writing rows.
{"mode": "export","spreadsheet": "1EXAMPLE_SHEET_ID_0000000000000000","sheetName": "Leads","datasetId": "EXAMPLEdatasetId00","serviceAccountJson": "<paste the whole JSON key file>","dryRun": true,"maxRows": 1}
Use it from code or an AI agent
Run this actor with the Apify API, the Apify Python or JavaScript (JS) clients, or as a tool through the Apify MCP server. Pass the same input JSON through any of these interfaces.
Sheets import rows preserve your spreadsheet headers and do not add a status field. Check the run’s key-value store OUTPUT.status (ok, limited or error) instead. Export returns its summary in OUTPUT, not dataset rows.
Minimal input:
{"mode": "import","spreadsheet": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"}
Setup: your own Google service account (one time)
A service account is a robot Google account you own. The Actor can reach only the sheets you share with it. Most Sheets failures happen here.
- In the Google Cloud Console, create a project or pick an existing one.
- Go to APIs & Services → Library, find Google Sheets API and click Enable. The Drive API isn't needed.
- Go to IAM & Admin → Service accounts → Create service account. It doesn't need any roles.
- Open the account, then go to Keys → Add key → Create new key → JSON. A
.jsonfile downloads. - In that file, copy the
client_emailvalue. It ends iniam.gserviceaccount.com. - Share the sheet with this email. In your spreadsheet, click Share, paste the email and choose Editor. Viewer is enough if you only import.
- Paste the entire JSON file into Service account key (JSON) in this Actor's input.
On Google Workspace, an admin policy may block keys or outside sharing. If so, ask your admin.
Input
| Field | What it does | Default |
|---|---|---|
mode | export (dataset → sheet) or import (sheet → dataset) | import |
spreadsheet | Sheet URL or ID | Google’s public sample sheet |
sheetName | Tab to use. Created on export if it's missing | Sheet1 |
serviceAccountJson | Full JSON key (secret), required for export or private imports | empty (public import) |
datasetId | Dataset to export | required for export |
writeMode | append, or replace (clears the tab first) | append |
columns | Export only these fields, in this order (address.city for nested fields) | all |
maxRows | Stop after this many rows (0 = all) | 0 |
skipEmptyRows | Import: skip blank rows | true |
dryRun | Plan only: no rows written, no row charges | false |
Nested objects become dotted columns, lists become JSON text, and empties become blank cells. The OUTPUT record summarizes each run: status (ok, limited on import or export spending limits, or error), row counts, spreadsheetUrl and, on export, columns. Import rowsImported counts rows actually delivered, including when the SDK spending limit stops a batch.
Output
Import writes one dataset item per sheet row. Keys are the header cells; every value is text. A blank header becomes column_N, and a repeated header becomes name, name_2.
{ "Student Name": "Alexandra", "Gender": "Female", "Class Level": "4. Senior", "Home State": "CA", "Major": "English", "Extracurricular Activity": "Drama Club" }
Export adds no dataset rows. The run summary is in the key-value store record OUTPUT:
{"mode": "export","spreadsheetUrl": "https://docs.google.com/spreadsheets/d/<id>/edit","sheetName": "Leads","status": "ok","rowsInDataset": 2500,"rowsWritten": 2500,"columns": ["title", "price", "address.city"],"finishedAt": "2026-10-21T08:00:00+00:00"}
status is ok, limited (stopped by the spending limit or the run timeout, with a message) or error (with error in plain words). A dry run adds "dryRun": true with rowsWritten: 0. Import OUTPUT has rowsImported, rowsInSheet and dryRun instead of rowsWritten and columns.
Pricing
Pay per event. You pay for two things:
| Event | Price | When |
|---|---|---|
row | $0.00015 per row (about $0.15 per 1,000 rows) | each row written to the sheet (export) or added to the dataset (import) |
apify-actor-start | $0.0025 per run | once per run, one event per GB of memory with a 1 GB minimum |
Examples:
- Export 10,000 rows: 10,000 x $0.00015 + $0.0025 = $1.5025.
- Import a 200-row tab: 200 x $0.00015 + $0.0025 = $0.0325.
- Dry run: no row charges, only the start fee ($0.0025).
Failed rows are never charged. If a run stops part-way, row charges apply only to the rows that landed. Set a maximum total charge on the run and export stops cleanly at that limit; OUTPUT then says how many rows were written. Prices shown here were read from the Store on 21 Oct 2026; the Pricing tab is the source of truth.
Reliability
- Input is checked before Google is contacted. That covers the sheet URL or ID, whether the key is a service-account JSON, and whether an export has a
datasetId. Errors name the field and never repeat your input. - A key that can't be read stops the run with "The service-account key could not be read. Paste the whole JSON key file you downloaded."
- A wrong ID or missing Editor access stops the run with a message that includes your service account's email and tells you to share the sheet with it as an Editor. If the Google Sheets API isn't enabled for the key's project, or the key was revoked, the message says that instead. No raw error traces.
- Rate limits and Google server errors (429, 5xx) are retried with exponential backoff, one 1,000-row chunk at a time, so earlier chunks aren't resent. Before a retry, the sheet is checked: if the failed write had in fact landed, it isn't written again.
- If an export fails part-way,
OUTPUTrecords the reason and the count, for example "1000 of 2500 rows were written before this". There's no automatic resume: running again in append mode starts from the first row, so delete the partial rows first or use replace. - A dataset that can't be opened (wrong or expired ID) stops the run with a message saying so, instead of a stack trace. Pick the dataset with the Dataset field's picker, or pass its ID through the API.
- A tab name that doesn't exist on import stops the run and lists the sheet's tabs. Nothing is imported or charged. Left at the default
Sheet1, the first tab is used. - Close to the run's timeout the export stops starting new chunks and ends with
status: limitedand a count of rows written, instead of timing out. - A dry run opens the sheet and reports the planned columns and row count without writing rows. On export it still creates a missing tab. It doesn't prove Editor access, because reading needs only Viewer.
For a quick connection test, set dryRun: true and maxRows: 1.
Use cases
- Lead-gen team: A marketing agency scrapes business listings nightly and appends each run's dataset to a "Leads" tab so the sales team can review new rows without re-downloading a file.
- Daily price reports: An e-commerce scraper produces a dataset per run, and a scheduled task replaces a "Daily report" tab each morning with only
title,price, andaddress.cityin a fixed column order. - Shared keyword lists: A content team keeps target keywords in a sheet and imports that tab into a dataset to feed the URLs into another actor that does the actual scraping.
- Public reference data: A developer pulls a sheet that's shared as "Anyone with the link can view" into a dataset without setting up a service account, using
maxRowsto test the output shape first. - Growing log file: A long-running scraper appends each batch of results to the same tab so past entries are kept, while new fields from later runs appear as extra columns on the right.
- Connection testing: Before wiring the actor into a schedule, an operator runs it with
dryRun: trueandmaxRows: 1to confirm the sheet URL and key are correct without writing rows.
FAQ
How do I export an Apify dataset to Google Sheets?
Set mode to export, give the sheet URL or ID, a sheetName, the datasetId and your service account key, share the sheet with the service account's email as Editor, then choose append or replace.
Can I import a Google Sheet without a Google account key?
Yes, if the sheet is shared as "Anyone with the link can view". Leave serviceAccountJson empty and the actor reads the tab through its CSV export. Private sheets need the service account.
Why do I need a service account? Only to write, or to read a private sheet. Google needs an identity to write. A service account means no password and no broad OAuth grant. It sees only the sheets you share, and you can revoke access by unsharing or deleting the key.
Is my key stored?
It's a secret input, so Apify stores it encrypted with the run input. The Actor never logs the key, never writes it to the dataset, OUTPUT or any other storage, and never echoes input in errors. The log shows the service account's email, not the key.
Will it reorder my columns?
Not when you append with columns left empty: existing columns stay where they are, and new fields go on the right. If you set columns, that list becomes the header exactly, so on a tab that already has data, match its order or use replace. Keep the header row free of blank cells.
Can I schedule it?
Yes, with Apify Schedules or tasks. For export, a fixed datasetId with append re-adds the same rows on every run, so use replace, or pass each new scraper run's dataset ID.
What does import return?
Every value comes back as text, as the sheet displays it. Blank headers become column_2, column_3 and so on. Repeated headers are kept apart as name, name_2, name_3, so no column is lost.
Can I use it as an Apify dataset to Google Sheets integration for any scraper?
Yes. Any Actor run's default dataset can be the source: pick it in the Dataset field, or pass its ID as datasetId from the API, a task or a schedule.
How many rows can I export?
The Actor sets no row cap of its own (use maxRows to set one). Rows are written in chunks of 1,000, and Google's own spreadsheet limits apply. Cell values longer than 50,000 characters are cut and marked …[truncated].
Are formulas evaluated on export? No, they're written as plain text.
Limits
- One dataset and one tab per run. There's no upsert or deduplication.
- Google caps a cell at 50,000 characters. Longer values are cut and marked
…[truncated], and Google's spreadsheet size limits also apply. - Google applies per-minute request quotas to each Cloud project. Export makes roughly one write request per 1,000 rows and backs off on 429.
-
- Replace with an empty dataset leaves the tab untouched.
Troubleshooting
| You see | Cause | Fix |
|---|---|---|
| "The service-account key could not be read" | Pasted only part of the key file | Paste the whole JSON file, from { to } |
| Message naming your service account's email and asking for Editor access | The sheet is not shared with that email, the Sheets API is not enabled for the key's project, or the key was revoked | Share the sheet with the client_email as Editor (Viewer for import) and enable the Google Sheets API |
| "export needs datasetId" | mode is export without a dataset | Pick one in the Dataset field, or pass datasetId through the API |
| Dataset could not be opened | Wrong or expired ID, or not selected with the picker | Select it with the picker; unnamed datasets expire after your plan's retention period |
| Import stops and lists the sheet's tabs | sheetName does not match a tab | Use one of the listed tab names; nothing is imported or charged |
status: limited in OUTPUT | Max total charge or run timeout reached | Raise the limit or timeout; in append mode remove the written rows first, or use replace |
| Same rows appear twice on a schedule | Fixed datasetId with append re-adds the same rows | Use replace, or pass each new scraper run's dataset ID |
Related tools
- Google Trends Scraper: track search interest for your keywords.
- Shopify Store Monitor: watch Shopify stores for new arrivals, price drops and sold-out products.
- YouTube Transcript Scraper: get video transcripts as text, SRT or VTT.
Support
Open an issue on the Issues tab with your input (remove the key first) and the error message.