Google Sheets Import & Export: Datasets to Sheets and Back avatar

Google Sheets Import & Export: Datasets to Sheets and Back

Pricing

from $0.54 / 1,000 sheet row processeds

Go to Apify Store
Google Sheets Import & Export: Datasets to Sheets and Back

Google Sheets Import & Export: Datasets to Sheets and Back

Import any Google Sheet into a dataset (public link, no login) or export an Apify dataset to a sheet: append or replace, one row per record. Service account or token.

Pricing

from $0.54 / 1,000 sheet row processeds

Rating

0.0

(0)

Developer

Detroit Web Agent - Open Data

Detroit Web Agent - Open Data

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

9 hours ago

Last modified

Features

Limited permissions

Share

Google Sheets import and export for Apify in one Actor. Import any Google Sheet into a dataset, one row per sheet row, with no login for sheets shared by link. Export any Apify dataset into a sheet, appending below existing rows or replacing the tab, with columns matched by header name. Every row comes back with the spreadsheet ID, tab, sheet row number and range, so you always know exactly what was read or written.

It talks to the Google Sheets endpoints directly over HTTP, so there is no browser, no proxy and no per-run setup. Public sheets need no credentials at all. Private sheets and every export use a service account key or an OAuth access token that you paste into a secret field.

Run in 30 seconds

  1. Open the Input tab. The prefilled link is a public sample sheet with 30 student rows.
  2. Click Start. The run takes a few seconds.
  3. Open the Rows table in the Output tab, or export the dataset as JSON, CSV or Excel.
  4. Paste your own sheet link and run again. Set Mode to Export and add a dataset ID to write data into a sheet instead.

What does this Actor do?

Two jobs, one input form.

Import (sheet to dataset). Give it a Google Sheets link or ID. It reads the tab you choose (the first tab by default, or the tab named in the #gid= part of the link), uses row 1 as field names and returns every following row as one dataset item. Numbers, TRUE and FALSE become real numbers and booleans, empty cells become null, and text such as 007 stays text. You can limit the read to an A1 range like A1:F100.

Export (dataset to sheet). Give it the ID of any Apify dataset, for example the default dataset of another Actor run, plus a spreadsheet and tab. It flattens each item, writes a header row if the tab is empty, and writes the rows in chunks. In append mode, new rows go under the existing data and fields are matched to the existing header names, with new fields added as extra columns on the right. In replace mode the tab is cleared first. A tab that does not exist is created for you.

Both modes return one dataset row per sheet row processed, with the same fields, so you can chain them in schedules, webhooks, n8n, Make or Zapier.

What you get

FieldMeaning
spreadsheetIdThe Google spreadsheet ID
spreadsheetTitleSpreadsheet title (filled when credentials are used, otherwise null)
sheetTab name
modeimport or export
rangeThe A1 range read or written, for example 'Class Data'!A1:F31
rowNumberThe row number in the sheet
rowsReadTotal rows read in this run (import) or taken from the dataset (export)
rowsWrittenRows written so far (export), null on import
cellCountNumber of filled cells in the row
columnCountNumber of columns in the row
changeStatusnew, changed or unchanged compared with the previous run (import with change tracking), otherwise null
rowHashShort fingerprint of the row content (import), null on export
dataThe row as an object: header name to cell value
scrapedAtWhen the row was processed

A run summary with the same counters, the list of tabs found and any warnings is stored in the OUTPUT key-value record.

What you get that other Sheets Actors do not describe: change tracking on import

Other Google Sheets Actors on the Store (for example lukaskrivka/google-sheets, bridgeworks/sheets-bridge, s_actors/google-sheets-import-export) write data into sheets, and some update only the rows that changed on export. Their listings do not describe the other direction: telling you which sheet rows changed since the last run. This Actor does that on import.

Switch on Track changes and every row comes back with changeStatus (new, changed or unchanged) and a rowHash. Add a Key column such as id and the comparison follows the row, not its position, so sorting or inserting rows does not flag everything. Switch on Return only new and changed rows and a scheduled run returns only what moved, which is what you feed to n8n, Make or Zapier. The run summary in OUTPUT also holds rowsNew, rowsChanged, rowsUnchanged and rowsRemoved.

The previous state is a small record of row fingerprints (not your cell values) in a key-value store named sheets-import-row-state in your own Apify account. The first run has nothing to compare with, so every row is new. Changing the tab, range or key column starts a new baseline.

Limits

  • Import without credentials works only on sheets shared as Anyone with the link: Viewer. Otherwise the run ends with a clear message telling you to share the sheet or add credentials.
  • Export always needs write access: a service account added to the sheet as Editor, or an OAuth access token with the spreadsheets scope. Access tokens last about an hour.
  • Google allows about 10 million cells per spreadsheet and 50,000 characters per cell. Longer text is cut at 49,000 characters.
  • Up to 200,000 rows per run. Large exports are written in chunks of up to 2,000 rows.
  • Formulas are not evaluated on import: you get the displayed value of each cell. On export values are written as given unless you switch on Interpret formulas and dates.

Input

FieldWhat it does
Modeimport (sheet to dataset) or export (dataset to sheet)
Spreadsheet link or IDFull URL or the ID between /d/ and /edit. #gid=123 selects a tab
Tab nameTab to read or write. Empty means the first tab
Range (import)Optional A1 range such as A1:F100 or B2:D
Max rowsImport: stop after this many rows. Export: write at most this many dataset items
First row is a headerOn: row 1 gives the field names. Off: fields are named A, B, C
Convert numbers and booleansTurns 42, 3.5, TRUE into real types
Skip empty rowsLeaves out rows where every cell is empty
Track changesImport only. Marks each row new, changed or unchanged since the previous run
Return only new and changed rowsImport only. Skips unchanged rows, so a schedule only pays for what moved
Key columnImport only. Header that identifies a row (for example id), so sorting or inserting rows is not read as a change
Dataset ID or URLExport only: the dataset to write
Write modeExport only: append or replace
ColumnsExport only: fields to write, in order. Nested fields use dots like address.city
Create the tab if missingExport only
Interpret formulas and datesExport only. Off by default, which is the safe choice for untrusted text
Service account JSONSecret. The full key file of a Google service account
OAuth access tokenSecret. Alternative to the service account

Example input: import a public sheet

{
"mode": "import",
"spreadsheetUrl": "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit#gid=0",
"maxRows": 100
}

Example input: export a dataset to a sheet

{
"mode": "export",
"spreadsheetUrl": "YOUR_SPREADSHEET_ID",
"sheetName": "Leads",
"datasetId": "YOUR_DATASET_ID",
"writeMode": "append",
"columns": ["name", "website", "address.city"],
"serviceAccountJson": "{ ...full key file... }"
}

Output sample (import)

{
"spreadsheetId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
"spreadsheetTitle": null,
"sheet": "Class Data",
"mode": "import",
"range": "'Class Data'!A1:F31",
"rowNumber": 2,
"rowsRead": 30,
"rowsWritten": null,
"data": {
"Student Name": "Alexandra",
"Gender": "Female",
"Class Level": "4. Senior",
"Home State": "CA",
"Major": "English",
"Extracurricular Activity": "Drama Club"
},
"scrapedAt": "2026-11-16T14:42:27.638Z"
}

How to set up a service account (about 3 minutes, once)

  1. In the Google Cloud console create a project and enable the Google Sheets API.
  2. Create a service account, then add a JSON key and download it.
  3. Open your spreadsheet, click Share, and add the service account's client_email address as Editor (Viewer is enough for import).
  4. Paste the whole JSON file into the Service account JSON field. It is a secret field, so Apify stores it encrypted and the Actor never prints it.

The service account can only see the sheets you shared with it. Nothing else in your Google account is reachable.

Use cases

  • Feed a sheet from any scraper. Run a scraper, then export its dataset to a Leads tab every morning. Append mode keeps history and matches the existing columns.
  • Use a sheet as a control panel. Keep keywords, URLs or SKUs in a sheet, import them on a schedule and pass them to other Actors.
  • Backups and snapshots. Import a team sheet into a dataset daily and keep a versioned copy.
  • Reporting. Replace a dashboard tab with fresh numbers after each run.
  • Data hand-off. Give non-technical teammates a sheet instead of a JSON file.

Pricing

Pay per event, no subscription. Current prices:

EventFreeBronzeSilverGoldPlatinumDiamond
Actor Start$0.00005$0.00005$0.00005$0.00005$0.00005$0.00005
Sheet row processed$0.0009$0.00084$0.00072$0.00054$0.00054$0.00054

Tier follows your Apify subscription plan.

Apify's free plan includes monthly platform credit that covers test runs.

Examples at the current price (one row event per result; Free-plan tier):

You pullYou pay
100 results$0.09
1,000 results$0.90
10,000 results$9.00

Scheduled runs stay cheap when each run only returns new records.

Integrations and scheduling

Schedule the Actor from the Apify console, then connect it with webhooks, Make, Zapier or n8n. A common setup is a webhook on your scraper's "run succeeded" event that starts this Actor in export mode with the run's default dataset ID. You can also call it through the REST API and the Python and JavaScript clients.

Use with the API, n8n, Make, Zapier or AI agents

API (one call, returns the rows as JSON):

$curl -X POST "https://api.apify.com/v2/acts/transparent_meteorite~google-sheets-import-export/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" -H "Content-Type: application/json" -d '{"mode":"import","spreadsheetUrl":"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms","maxRows":100}'

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("transparent_meteorite/google-sheets-import-export").call(run_input={
"mode": "import",
"spreadsheetUrl": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
"maxRows": 100,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
print(row["rowNumber"], row["data"])
  • n8n, Make, Zapier: use the Apify app's "Run Actor" step with actor transparent_meteorite/google-sheets-import-export, paste the input JSON and map data to your next step.
  • AI agents (MCP): connect the Apify MCP server at https://mcp.apify.com?tools=transparent_meteorite/google-sheets-import-export to Claude, Cursor or any MCP client, and your agent can read or write sheets as a tool.

Security and fair use

Credentials go in secret input fields, are used only to call Google, and are never written to logs, the dataset or the OUTPUT record. Use a dedicated service account that has access only to the sheets you need. Exports are written as raw values by default, so text that starts with = is not executed as a formula. Only read sheets you own or have permission to read. This is an independent tool and is not affiliated with Google.

FAQ

Do I need a Google login or API key to import? No, as long as the sheet is shared as "Anyone with the link". For private sheets add a service account or token.

Can it export without credentials? No. Google only allows writes from an authenticated account, so export needs a service account or access token.

Which tab is read? The tab selected by Tab name, otherwise the #gid= in your link, otherwise the first tab.

Will formulas be kept? Import returns the value shown in each cell. Export writes values only, unless you switch on Interpret formulas and dates.

What happens to nested JSON in a dataset? Nested objects are flattened into dotted columns like address.city. Arrays are written as JSON text in one cell.

What if my header row has duplicates or blanks? Duplicates get a numeric suffix (name, name_2) and blank headers become column3 and so on.

Why did my run end with a message and no rows? Bad input, such as a private sheet without credentials or an unknown tab name, finishes as a normal run with the reason in the status message and the OUTPUT record, and nothing is charged.

Is there a size limit? Up to 200,000 rows per run; split larger jobs with the range option.

Support

Found a sheet that reads or writes badly? Open an issue on the Issues tab with the run URL. Never paste a key into an issue.

New to Apify? Create a free account and run this Actor in under a minute.

Changelog

  • 0.2: Change tracking on import (changeStatus, rowHash, key column, only-changed mode) and cellCount / columnCount on every row.
  • 0.1: First private build. Import by link or API, export with append or replace, header matching, row numbers, deadline and cost guards.