# Google Sheets Import and Export (`mambalabs/google-sheets-import-export`) Actor

Read a Google Sheet into an Apify dataset, or write an Apify dataset or a list of rows into a Google Sheet: append, replace, or update rows by a key column. Works on your own Google service account or OAuth token; a sheet shared as anyone with the link reads with no credential.

- **URL**: https://apify.com/mambalabs/google-sheets-import-export.md
- **Developed by:** [Mamba Labs](https://apify.com/mambalabs) (community)
- **Categories:** Integrations, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.50 / 1,000 rows written, per block of up to 100s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Sheets Import and Export

Read a Google Sheet into an Apify dataset, or write an Apify dataset or a list of rows into a Google Sheet. Read mode returns one row per sheet row, keyed by the header row. Append, replace, and upsert modes write rows into a tab, add new columns to the header as they appear, and in upsert mode overwrite the rows whose key column value is already in the sheet. Writes run on your own Google credential: a service account key or an OAuth token. A sheet shared as "anyone with the link" reads with no credential. You pay per block of up to 100 rows.

### Features

- **Read any tab** into JSON rows keyed by its header row, with the sheet row number on each row. Pick the tab by name, by gid, or by the gid in the URL, and limit the read to an A1 range.
- **Export an Apify dataset** to a sheet: pass the dataset ID, or {{resource.defaultDatasetId}} from an Apify integration, and every item becomes a sheet row.
- **Append, replace, or upsert.** Append adds rows after the last row. Replace clears the tab, then writes. Upsert overwrites the rows whose `key_column` value already exists and adds the rest.
- **Header matching.** Your row keys are matched to the sheet's header columns, whatever their order. A key the header does not have becomes a new column at the end.
- **Safe values.** Values are stored as plain text by default, so a scraped value that starts with `=` is not run as a formula. Set `value_input` to `user_entered` to have Google parse formulas, dates, and numbers.
- **Never bills a write it could not deliver.** Before each write the actor checks your charge limits, and it never writes a block of rows it could not charge.

### How the data is read

The actor calls the Google Sheets API v4 (`sheets.googleapis.com`) with your own credential. A service account key is exchanged for a one hour access token at `oauth2.googleapis.com`; a refresh token is exchanged the same way with its OAuth client. Your credential is sent only to Google and is never stored, logged, or written to a row. With no credential, read mode fetches Google's own CSV export of a sheet shared as "anyone with the link". No proxy, no browser, and no other developer's actor. Your use of the Sheets API runs on your own Google project under Google's API terms.

**Setting up a service account.** In Google Cloud, create a service account, enable the Google Sheets API on its project, create a JSON key, and paste the whole file into `service_account_json`. Then share the spreadsheet with the service account's `client_email` as an Editor (a Viewer is enough to read).

**Testing.** Read mode on a public sheet was tested live on 2026-11-17. The write modes and the credential routes were tested against recorded Google responses and a refused key path from inside an Apify run. The first buyer's credential is the live test of the write path.

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `mode` | string | `read` | read (default): the sheet becomes one dataset row per sheet row. append: add rows after the last row. replace: clear the tab, then write the rows. upsert: overwrite the rows whose key_column value is already in the sheet and add the rest. The three write modes need a credential below. |
| `spreadsheet` | string |  | The Google Sheets URL as copied from the browser, or the spreadsheet ID. A #gid= in the URL picks that tab. |
| `sheet` | string |  | Optional. The tab name, or its gid number. Default: the gid in the URL, else the first tab. In a write mode a tab name that does not exist is created. |
| `range` | string |  | Optional, read mode. An A1 range without the tab name, for example A1:F500 or B:D. Default: the whole tab. |
| `header_row` | string | `true` | true (default) or false. When true, read rows are keyed by the header row, and writes match your row keys to the header columns and add new columns at the end. When false, read rows are keyed by column letter and writes go column by column in key order. |
| `dataset_id` | string |  | Write modes. The Apify dataset whose items go into the sheet, for example the default dataset of another run. In an Apify integration, pass the triggering run's resource.defaultDatasetId variable. Fields starting with # are skipped. |
| `rows` | array |  | Write modes, instead of a dataset. A JSON list of objects, one per sheet row, for example \[{"name": "Ann", "email": "ann@example.com"}]. |
| `columns` | array |  | Optional, write modes. Only these keys are written, in this order. Default: every key in the rows, in first seen order. |
| `key_column` | string |  | Upsert mode. The column whose value identifies a row, for example email or url. A row whose value is already in that column is overwritten in place; the rest are added. Rows with no value in it are skipped. |
| `value_input` | string | `raw` | raw (default): every value is stored exactly as given, so text starting with = is not run as a formula. user_entered: Google parses values as if typed, so formulas run and dates and numbers are converted. |
| `max_rows` | string | `100000` | Most rows to read or write in this run, 1 to 1,000,000 (default 100,000). |
| `service_account_json` | string |  | Your own service account key file, pasted whole. Share the spreadsheet with its client_email as an Editor (Viewer to read). It is sent only to Google and is never stored, logged, or written to a row. |
| `oauth_refresh_token` | string |  | Instead of a service account: a refresh token from your own Google OAuth client with the spreadsheets scope. Needs oauth_client_id and oauth_client_secret from the same client. |
| `oauth_client_id` | string |  | The client ID that issued the refresh token. |
| `oauth_client_secret` | string |  | The client secret that issued the refresh token. |
| `oauth_access_token` | string |  | Instead of the above: a current OAuth access token with the spreadsheets scope. It expires in about an hour, so it suits a single run. |
| `max_charge_usd` | string |  | Optional. The run stops before a charge that would pass this amount, and never writes a block of rows it could not charge. Summary rows are always returned. |

### Output

| Field | Type | What it holds |
|---|---|---|
| `row_type` | string | One of: sheet_row, read_receipt, write_receipt, run_summary. run_summary is the one free row written when the input is refused. |
| `spreadsheet_id` | string | The ID of the spreadsheet, from its URL. |
| `sheet` | string | The tab the run read or wrote, by name. A public read by gid shows the gid. |
| `mode` | string | read, append, replace, or upsert, as run. |
| `access` | string | How the actor reached the sheet: public_link (no credential, a sheet shared as anyone with the link), service_account, refresh_token, or access_token. |
| `row_number` | integer | On a sheet_row: the row number in the sheet, from 1. |
| `values` | object | On a sheet_row: the row as column name to cell text, using the header row. With header_row off, the keys are column letters. |
| `cells` | array | On a sheet_row: the row's cells in column order, as text. |
| `rows_in_block` | integer | On a receipt: how many rows this billed block covers, 1 to 100. |
| `range` | string | On a receipt: the sheet range read or written, as Google reported it. |
| `rows_read` | integer | On the summary row: sheet rows delivered in this run. |
| `rows_written` | integer | On the summary row: rows written to the sheet in this run, updated plus appended. |
| `rows_updated` | integer | On the summary row in upsert mode: existing rows overwritten in place. |
| `rows_appended` | integer | On the summary row: rows added as new sheet rows. |
| `row_status` | string | ok, or why this row carries no data: no_results, no_change, partial, blocked, or error. |
| `error_reason` | string | Why the row is not ok. A refused input reads input_invalid: followed by what to fix. |
| `billable_events_json` | string | What this row was billed as, for example {"rows-written":1}. {} means free. |
| `scraped_at` | string | When the row was written, UTC. |

Row types: `sheet_row` (one per sheet row in read mode, free), `read_receipt` (one per block of up to 100 rows read, billed), `write_receipt` (one per block of up to 100 rows written, billed), and `run_summary` (one per run, free). To work with only the sheet data, filter the dataset to `row_type` `sheet_row`.

### Pricing

Pay per event. Mamba Labs pays the platform costs of the run. Summary rows, empty reads and writes, a refused credential, and a refused input are free.

| Event | Free plan | Bronze | Silver | Gold |
|---|---|---|---|---|
| `rows-written`, one block of up to 100 rows written to your sheet | $0.01 | $0.0095 | $0.009 | $0.0085 |
| `rows-read`, one block of up to 100 sheet rows read into the dataset | $0.005 | $0.00475 | $0.0045 | $0.00425 |
| `apify-actor-start`, once per run (one per GB of memory; the default 256 MB is one) | $0.002 | $0.002 | $0.002 | $0.002 |

Per 1,000 rows of `rows-written` (10 blocks of 100): $0.10 on the free plan, $0.09 on Gold.

Free plan cap: 1.50 USD of evaluation a month, about 15000 rows. Any paid Apify plan removes the cap, and it resets on the 1st. The run stops before a charge that passes your maximum charge per run in Apify or your `max_charge_usd` input.

Mamba Labs pays the platform costs of your run, Apify proxy traffic included.

A write of 250 rows is 3 blocks. A read of 1,000 rows is 10 blocks.

### Usage examples

**Export a dataset after every run.** Add this actor as an integration on another actor, with `mode` `append`, your `spreadsheet` URL, `dataset_id` {{resource.defaultDatasetId}}, and your service account key.

**Keep a sheet in sync.** Run with `mode` `upsert` and `key_column` `url` (or `email`, or any column that identifies a row). Rows already in the sheet are updated in place; new ones are added.

**Clay.** Number and on or off inputs are text fields, which is what Clay sends. A list input takes a JSON list, so put the column inside a one item list. `rows` also takes JSON text.

**MCP.** The Mamba Labs MCP server `@mambalabsdev/mcp-google-sheets-import-export` exposes this actor to Claude and other MCP clients.

### Error handling

| Case | What you get |
|---|---|
| Missing or unreadable input | One free row, `row_type` `run_summary`, `error_reason` starting `input_invalid:` with what to fix. The run ends successfully and charges nothing but the run start (`apify-actor-start`) |
| Google refuses the credential | One free `run_summary` row with `row_status` `blocked` and `error_reason` starting `key_refused:` with Google's reason. Nothing is written |
| The credential has no access to the sheet | One free `blocked` row starting `no_access:`. For a service account it names the email to share the sheet with |
| A private sheet with no credential | One free `blocked` row that says to share it as "anyone with the link" or give a credential |
| No spreadsheet or tab with that ID or name | One free `no_results` row starting `not_found:`. In a write mode, a tab name that does not exist is created instead |
| The Sheets API rate limit | The actor waits and retries up to 4 times, then stops with a free `blocked` row. Rows already written stay written and billed |
| Your charge limit is reached | The run stops before the next block, writes nothing it could not charge, and the summary row says from which position rows were not written |
| The run is close to its timeout | The actor stops starting new work 90 seconds before the timeout and delivers what it has |

### Limitations

- Read mode returns the cell text as shown in the sheet (formatted values), not the formulas.
- A public read by tab name uses Google's gviz export. It can return empty cells in a column that mixes numbers and text, it leaves out rows hidden by a filter left on the tab, and a tab name that does not exist returns the first tab instead of an error. Read by gid (the number after `#gid=` in the URL) to avoid all three; that uses the CSV export. Reads with a credential use the Sheets API and do not have these limits.
- Upsert matches on exact text after trimming spaces. Rows with no value in `key_column` are skipped and counted on the summary row. Inside one write, the last row with a given key wins.
- Objects and lists in your rows are written as JSON text. A cell holds at most 50,000 characters; longer values are cut, and the summary row counts them.
- Replace clears the whole tab, formatting kept, values removed.
- The Google Sheets API allows 60 write requests a minute per user by default. The actor writes up to 500 rows per request and waits when Google asks it to.
- An OAuth access token expires in about an hour. For runs longer than that, use a service account key or a refresh token.

### Mamba Labs actor suite

| Actor | Actor ID |
|---|---|
| [Account Hiring Watch](https://apify.com/mambalabs/account-hiring-watch?fpr=mamba) | `gRAZA5WBi1r6L0gy7` |
| [Agent Accessibility Auditor](https://apify.com/mambalabs/agent-accessibility-auditor?fpr=mamba) | `anxbRv0lKrpQ1pnua` |
| [Agent to Brokerage Resolver](https://apify.com/mambalabs/agent-brokerage-resolver?fpr=mamba) | `ePRRGLxOGyaVHO4dI` |
| [AI Answer Visibility Tracker](https://apify.com/mambalabs/ai-answer-visibility-tracker?fpr=mamba) | `RJZvzKniYK4nswcMg` |
| [AI List Extractor for Any Website](https://apify.com/mambalabs/ai-list-extractor-any-website?fpr=mamba) | `D5hOdIez45M0NX5jD` |
| [AI Tooling Detector](https://apify.com/mambalabs/ai-tooling-detector?fpr=mamba) | `EwkHhmqiuJgRoVEbE` |
| [Amazon Product, Price, and Stock Tracker](https://apify.com/mambalabs/amazon-product-price-stock-tracker?fpr=mamba) | `MtJPZoyjJ3IeqTFyo` |
| [Amazon Top Reviews Scraper](https://apify.com/mambalabs/amazon-top-reviews-scraper?fpr=mamba) | `wh6Mq6G6BlW1CRPwx` |
| [API Deprecation and Breaking Change Monitor](https://apify.com/mambalabs/api-change-monitor?fpr=mamba) | `pHsbS3xXUK8Jqutz5` |
| [App Store and Google Play Review Monitor](https://apify.com/mambalabs/app-store-google-play-review-monitor?fpr=mamba) | `MaCMEhGrbchxQZ92G` |
| [B2B Reddit Conversation Monitor](https://apify.com/mambalabs/b2b-reddit-conversation-monitor?fpr=mamba) | `SoDryzzsjmY3SsiyG` |
| [B2B Social Video Transcripts](https://apify.com/mambalabs/b2b-social-video-transcripts?fpr=mamba) | `dG2UYVKE2e4zfDucK` |
| [Bluesky Brand Presence Mapper](https://apify.com/mambalabs/bluesky-brand-presence-mapper?fpr=mamba) | `eLpxzP4IuXznlFVND` |
| [Bluesky Posts Scraper](https://apify.com/mambalabs/bluesky-posts-scraper?fpr=mamba) | `KldSjS7wjoeZ7vQGm` |
| [Brand Sponsor Finder](https://apify.com/mambalabs/brand-sponsor-finder?fpr=mamba) | `PPgK6xrgOmvL7Nrys` |
| [Bulk WHOIS and RDAP Domain Age Lookup](https://apify.com/mambalabs/whois-domain-lookup?fpr=mamba) | `MTrkG5FLU6SjqLdJY` |
| [Business PDF Field Extractor](https://apify.com/mambalabs/business-pdf-field-extractor?fpr=mamba) | `vM7JCk0CMAx5W0oJh` |
| [Career Change Signal Engine](https://apify.com/mambalabs/career-change-signal-engine?fpr=mamba) | `vX2Yga1a6wGaXaP14` |
| [Company Careers Page Jobs, 17 ATS Boards](https://apify.com/mambalabs/ats-jobs-feed?fpr=mamba) | `izP0rfIgf5YaRZfIh` |
| [Company Change Event Feed](https://apify.com/mambalabs/company-change-event-feed?fpr=mamba) | `oX44rS0fkEJ3rXLWe` |
| [Company Discovery List Builder](https://apify.com/mambalabs/company-discovery-list-builder?fpr=mamba) | `jch0HdaZnpbMqlcGS` |
| [Company Firmographic Enricher](https://apify.com/mambalabs/company-firmographic-enricher?fpr=mamba) | `YlUtLWjfPpqykmB8g` |
| [Company Funding Record](https://apify.com/mambalabs/funding-investor-record?fpr=mamba) | `OFS4Mt1gyYNtGfUbE` |
| [Company Headcount Estimator](https://apify.com/mambalabs/company-headcount-estimator?fpr=mamba) | `aHC4GROnNt6kfZe5r` |
| [Company Identity Resolver](https://apify.com/mambalabs/company-identity-resolver?fpr=mamba) | `lr8fTRAmZCBZmuwwh` |
| [Company Role Email, Phone and Address Finder](https://apify.com/mambalabs/company-contact-details-extractor?fpr=mamba) | `4mMncKaJykiq94grz` |
| [Company Social Presence Mapper](https://apify.com/mambalabs/company-social-presence-mapper?fpr=mamba) | `4k6CCemkgBDz18m2h` |
| [Competitor Price, Stock, and Changelog Monitor](https://apify.com/mambalabs/competitor-price-stock-changelog-monitor?fpr=mamba) | `yxdgCbUQ4PYQWwRNU` |
| [Contact Classifier](https://apify.com/mambalabs/contact-classifier?fpr=mamba) | `0lGSeYJmniXhGANnO` |
| [Contractor License Search, CA, TX, WA, OR, LA](https://apify.com/mambalabs/contractor-license-lookup?fpr=mamba) | `WBYK3CPI2kdeq4bP1` |
| [CRM Contact Job Change Checker](https://apify.com/mambalabs/job-change-tracker?fpr=mamba) | `L8UbEmMJC1XYPSZOb` |
| [Domain Deliverability Checker](https://apify.com/mambalabs/domain-deliverability-checker?fpr=mamba) | `0tVgxI7A6o9jMlxmc` |
| [Domain to LinkedIn URL Resolver](https://apify.com/mambalabs/domain-to-linkedin-url-resolver?fpr=mamba) | `3HtnSaqPHOg1Qg5gx` |
| [Ecommerce Platform Profiler](https://apify.com/mambalabs/ecommerce-platform-profiler?fpr=mamba) | `5G2NeYjBbQTjaTn9L` |
| [Ecommerce Store Discovery](https://apify.com/mambalabs/ecommerce-store-discovery?fpr=mamba) | `PeHu4sLyFvQHXUUrX` |
| [Email List Verifier, Bring Your Own Key](https://apify.com/mambalabs/email-verifier?fpr=mamba) | `CzVJ4NlaCKk80xpgE` |
| [Event Presence Index](https://apify.com/mambalabs/event-presence-index?fpr=mamba) | `WLhMy8fMDgsxdYxv5` |
| [Eventbrite Events Scraper](https://apify.com/mambalabs/eventbrite-events-scraper?fpr=mamba) | `sgc6znyrbjOy5Yk9f` |
| [Expert Witness Finder, US and Australia](https://apify.com/mambalabs/expert-witness-directory?fpr=mamba) | `LIpwlgfE3LaQBaXd4` |
| [Facebook Posts Scraper](https://apify.com/mambalabs/facebook-posts-scraper?fpr=mamba) | `T6jxIeq4ua0SLXnqG` |
| [Funding and Press Signal Scanner](https://apify.com/mambalabs/funding-press-signal-scanner?fpr=mamba) | `FS13X6dhQVgX3XOM6` |
| [GDPR Cookie Banner and Consent Checker](https://apify.com/mambalabs/cookie-consent-audit?fpr=mamba) | `TrKyOS0KBoGC35nbr` |
| [GitHub Followers and Following Export](https://apify.com/mambalabs/github-followers-following-export?fpr=mamba) | `SGNxDmFb9v3tRDaFI` |
| [GitHub Organization Signal Scanner](https://apify.com/mambalabs/github-organization-signal-scanner?fpr=mamba) | `ahF8RRpv5mzPao5CN` |
| [Google Ads Transparency Center Scraper by Domain](https://apify.com/mambalabs/google-ads-transparency-monitor?fpr=mamba) | `1eOwxhBVxzvOXAm4s` |
| [Google Maps Places Scraper](https://apify.com/mambalabs/google-maps-places-scraper?fpr=mamba) | `SuvHCNJ7pIuw6gn54` |
| [Google Trends Scraper](https://apify.com/mambalabs/google-trends-scraper?fpr=mamba) | `OeDzaACKmBYJXzHZk` |
| [GTM Hiring Signal Scraper](https://apify.com/mambalabs/gtm-hiring-signal-scraper?fpr=mamba) | `D7O1SA2EqwHGsGr1P` |
| [GTM Signals Aggregator](https://apify.com/mambalabs/b2b-buying-signals-hiring-tech-stack-intent-for-clay?fpr=mamba) | `xKdRfnfFNkdMpFuNs` |
| [Healthcare Provider NPI Enricher](https://apify.com/mambalabs/healthcare-provider-npi-enricher?fpr=mamba) | `MrgbHzcpDq3mOv9Df` |
| [ICP Fit Scorer](https://apify.com/mambalabs/icp-account-lead-scoring-fit-scorer-0-100-for-clay?fpr=mamba) | `W161DT8W4kW55dMFh` |
| [Influencer Change Monitor](https://apify.com/mambalabs/creator-change-monitor?fpr=mamba) | `d2VVgahNL6UmcLkhg` |
| [Influencer Lead List Builder](https://apify.com/mambalabs/creator-lead-list-all-in-one?fpr=mamba) | `KnmByszcv135yM30G` |
| [Influencer Profile Scraper](https://apify.com/mambalabs/creator-profile-reader?fpr=mamba) | `EqEnklDVMIcB1V499` |
| [Influencer Search Across TikTok, Instagram and YouTube](https://apify.com/mambalabs/creator-finder?fpr=mamba) | `tpkedmloIIWtXx6sg` |
| [Influencer Talent Agency Lookup](https://apify.com/mambalabs/talent-agency-lookup?fpr=mamba) | `zCuX4Mgyg6JvXgGzd` |
| [Instagram Facebook Brand Presence Mapper](https://apify.com/mambalabs/meta-brand-presence-mapper?fpr=mamba) | `HXh65I0JBjPsunbY8` |
| [Integration and Marketplace Presence Mapper](https://apify.com/mambalabs/integration-marketplace-presence-mapper?fpr=mamba) | `V0guNuvM85Q61f2gj` |
| [Job Board Keyword Signal Scanner](https://apify.com/mambalabs/job-board-keyword-signal-scanner?fpr=mamba) | `4DvqpvhMR74NLcDDY` |
| [Job Posting Monitor](https://apify.com/mambalabs/gtm-job-discovery?fpr=mamba) | `QCfICD9kOPiOdj5iI` |
| [Journalist and Media List Builder](https://apify.com/mambalabs/journalist-media-list-builder?fpr=mamba) | `mAfizsZC8qRoR0ecS` |
| [Launch Directory List Builder](https://apify.com/mambalabs/launch-directory-list-builder?fpr=mamba) | `cRq3bmvEZxZtioQ7U` |
| [Lead File Import Checker](https://apify.com/mambalabs/lead-file-import-checker?fpr=mamba) | `RwlGVXTf46LqZdUgt` |
| [Legal Entity Resolver](https://apify.com/mambalabs/legal-entity-resolver?fpr=mamba) | `KHFyPCDIx7CyqULYm` |
| [Link in Bio Scraper and Newsletter Detector](https://apify.com/mambalabs/link-in-bio-newsletter-checker?fpr=mamba) | `OorucdheTIgu7RFzK` |
| [LinkedIn Company Page Mapper](https://apify.com/mambalabs/linkedin-company-presence-mapper?fpr=mamba) | `zOPm6A9JEhUGcIdFW` |
| [LinkedIn Jobs Feed](https://apify.com/mambalabs/linkedin-jobs-feed?fpr=mamba) | `SH6N0d8cz46BhCC8B` |
| [LinkedIn Post Tracker](https://apify.com/mambalabs/linkedin-post-engager-capture?fpr=mamba) | `oiGLNPuaf5BRaz9K5` |
| [Local Business Lead Builder](https://apify.com/mambalabs/local-business-lead-builder?fpr=mamba) | `qMN97aoHhsAS5bznV` |
| [Local Rank and Map Pack Tracker](https://apify.com/mambalabs/local-rank-map-pack-tracker?fpr=mamba) | `gv0kyHGDIg8XscclB` |
| [Lookalike Companies from Seed Domains](https://apify.com/mambalabs/lookalike-company-finder?fpr=mamba) | `e2O426WBAbLLQL4Z2` |
| [Manufacturer and Supplier Finder](https://apify.com/mambalabs/manufacturer-supplier-finder?fpr=mamba) | `Qcsdmd0lUfPzVkonh` |
| [MCP Server Change and Health Monitor](https://apify.com/mambalabs/mcp-server-change-health-monitor?fpr=mamba) | `IeqjWF9U0BdDQFY08` |
| [Media URL Transcriber](https://apify.com/mambalabs/media-url-transcriber?fpr=mamba) | `Syfr7Ya3EsHgWfrB6` |
| [Meta Ad Library Ads by Company, Graph API](https://apify.com/mambalabs/meta-ad-library-monitor?fpr=mamba) | `J1GWlSXfSGU3u8Wng` |
| [Mobile Phone Waterfall](https://apify.com/mambalabs/mobile-phone-waterfall-orchestrator?fpr=mamba) | `6OOgPktf7RIa5XCOP` |
| [Multi Platform Social Posts and Comments](https://apify.com/mambalabs/multi-platform-social-posts-comments?fpr=mamba) | `icFuHR1EzDvUcfCQ5` |
| [Netherlands Rental Listings](https://apify.com/mambalabs/dutch-rental-listings?fpr=mamba) | `sGKGsbwoX18lFb6dR` |
| [New Hire Finder](https://apify.com/mambalabs/new-hire-finder?fpr=mamba) | `cKuc38p4nYHNF3IW8` |
| [Newly Registered Companies, UK, Norway, Finland, France](https://apify.com/mambalabs/new-company-registrations-feed?fpr=mamba) | `g2WfZhWvCtc57g2Jo` |
| [News and Media Mention Monitor](https://apify.com/mambalabs/news-media-mention-monitor?fpr=mamba) | `gol1PPUKrsIk4QLBd` |
| [News Site Article Archive](https://apify.com/mambalabs/news-site-article-archive?fpr=mamba) | `NjcF3UD8791raFNHh` |
| [Newsletter Sponsor Tracker](https://apify.com/mambalabs/newsletter-sponsor-tracker?fpr=mamba) | `qSwpqxD1TiPZpLQHv` |
| [Open Tender and RFP Finder](https://apify.com/mambalabs/open-tender-rfp-finder?fpr=mamba) | `kPTGz6t6TFoUUyfaO` |
| [Outbound Stack Detector](https://apify.com/mambalabs/outbound-infrastructure-fingerprint?fpr=mamba) | `v43UJC8r7qW7cBSTG` |
| [Page Finder and Extractor](https://apify.com/mambalabs/page-finder-extractor?fpr=mamba) | `TpurgcOZbVnknlaiC` |
| [Partner and Member Directory Extractor](https://apify.com/mambalabs/partner-member-directory-extractor?fpr=mamba) | `ZX0XJPPUvnFJxeC1a` |
| [People Finder & Email Verifier](https://apify.com/mambalabs/people-finder?fpr=mamba) | `LEgloG7tWgQl4o6TD` |
| [Person LinkedIn URL Resolver](https://apify.com/mambalabs/person-linkedin-url-resolver?fpr=mamba) | `ssuyPV8LnEsL8qbnb` |
| [Person Social Footprint Mapper](https://apify.com/mambalabs/person-social-footprint-mapper?fpr=mamba) | `jfQXa2zW9FHCJot9K` |
| [Personal Email to Company Resolver](https://apify.com/mambalabs/personal-email-to-company-resolver?fpr=mamba) | `AefT5Ye6YNPFQwJBf` |
| [Pinterest Brand Presence Mapper](https://apify.com/mambalabs/pinterest-brand-presence-mapper?fpr=mamba) | `d1HvjZfKhgvWsoEwn` |
| [Podcast Guest and Host Finder](https://apify.com/mambalabs/podcast-guest-host-finder?fpr=mamba) | `o2MGSvgbSLeeXOsIo` |
| [Private Company Funding History](https://apify.com/mambalabs/private-company-funding-history?fpr=mamba) | `H02K3rQIVOYpnLYc3` |
| [Product Hunt Daily Launches with Maker Domains](https://apify.com/mambalabs/product-hunt-launches-feed?fpr=mamba) | `O4VX63drWK9Y9x641` |
| [Property Owner Records](https://apify.com/mambalabs/property-owner-records?fpr=mamba) | `0J7ovG1iaZpQD1P0T` |
| [Prospect Engine](https://apify.com/mambalabs/b2b-prospect-engine?fpr=mamba) | `q9rT6v64nUJdPexOQ` |
| [Public Feature Board and Roadmap Monitor](https://apify.com/mambalabs/public-feature-board-roadmap-monitor?fpr=mamba) | `rcHF5gj5r2Vqnry35` |
| [Publishing Frequency Tracker](https://apify.com/mambalabs/blog-publishing-frequency?fpr=mamba) | `TbLwaUUATdYb6wp4N` |
| [Recent Funding Rounds Feed](https://apify.com/mambalabs/recent-funding-rounds-feed?fpr=mamba) | `KueVp9MOz7iOoAgDp` |
| [Reddit Brand Presence Mapper](https://apify.com/mambalabs/reddit-brand-presence-mapper?fpr=mamba) | `pKQZmDaT70SEb54bZ` |
| [Reddit Search and Thread Scraper](https://apify.com/mambalabs/reddit-search-thread-scraper?fpr=mamba) | `4Gsth5cP2Xt9V2xDN` |
| [Reporting Window Finder](https://apify.com/mambalabs/public-company-reporting-window-finder?fpr=mamba) | `uINxR7a1IW8qUTRUX` |
| [Research Topic Institutions and Authors](https://apify.com/mambalabs/research-topic-institutions-authors?fpr=mamba) | `OH8ANqt7bCKbo72Gk` |
| [Semrush Domain Metrics](https://apify.com/mambalabs/semrush-domain-metrics?fpr=mamba) | `3dqa0abJrpssHtrYL` |
| [Sequencer Event Poller](https://apify.com/mambalabs/sequencer-event-poller?fpr=mamba) | `S6s8Rjd61tGdrMRk4` |
| [Sequencer Lead Push](https://apify.com/mambalabs/clay-to-instantly-smartlead-push?fpr=mamba) | `0Jv27VeWM5tSZQs9x` |
| [Shopify App Store and Chrome Web Store Listings](https://apify.com/mambalabs/shopify-app-store-chrome-web-store-listings?fpr=mamba) | `gaY0BzkLyN77mD3wI` |
| [Site Crawler for Links and Tables](https://apify.com/mambalabs/site-crawler-links-tables?fpr=mamba) | `lLLJ6JxZ4XqN8ULz0` |
| [Streaming Subscription Prices by Country](https://apify.com/mambalabs/streaming-subscription-prices-by-country?fpr=mamba) | `tbMroS2Zyn57bW17E` |
| [Substack Newsletter and Posts Scraper](https://apify.com/mambalabs/substack-scraper?fpr=mamba) | `UEFsdwiPLmPNVy9xd` |
| [Team Page People Extractor](https://apify.com/mambalabs/team-page-people-extractor?fpr=mamba) | `j8a9zX0k4mNbvDbWK` |
| [Tech Stack Signal Detector](https://apify.com/mambalabs/gtm-tech-stack-signal-scraper?fpr=mamba) | `qyd7nNyqFPelQViBx` |
| [Tennis Match Data](https://apify.com/mambalabs/tennis-match-data?fpr=mamba) | `v3OX6zxXHZOf2yurO` |
| [Threads Posts by Keyword, Exact Match](https://apify.com/mambalabs/threads-keyword-search?fpr=mamba) | `2OT8K8RiEEWtaj2MW` |
| [Ticketmaster Event Prices](https://apify.com/mambalabs/ticketmaster-event-prices?fpr=mamba) | `CrvPX4IwLXQX9bls1` |
| [TikTok Brand Presence Mapper](https://apify.com/mambalabs/tiktok-brand-presence-mapper?fpr=mamba) | `fco8FvoJcSafbeyd1` |
| [TikTok Video Stats](https://apify.com/mambalabs/tiktok-video-stats?fpr=mamba) | `uz9Q3cEycRgA6NfqA` |
| [Trustpilot Reputation Enricher](https://apify.com/mambalabs/review-platform-reputation-enricher?fpr=mamba) | `3lIqfCt61j4hqE1xz` |
| [US and UK Contract Award Winners by Company](https://apify.com/mambalabs/public-award-monitor?fpr=mamba) | `zhEtllASykOcx9hJ8` |
| [US Import Records Buyer Finder](https://apify.com/mambalabs/us-import-records-buyer-finder?fpr=mamba) | `VIMafpKF5ggOw0COU` |
| [VC and Accelerator Portfolio List Builder](https://apify.com/mambalabs/vc-accelerator-portfolio-list-builder?fpr=mamba) | `chH8hrfuoqqolW06m` |
| [Website Accessibility Checker, WCAG 2.2 AA](https://apify.com/mambalabs/wcag-accessibility-audit?fpr=mamba) | `P3jBj3FRghKEhX52z` |
| [Website Phrase and Business Model Classifier](https://apify.com/mambalabs/website-phrase-business-model-classifier?fpr=mamba) | `CBuZ9k7sRwBeiKiCS` |
| [Website Traffic Rank Estimator](https://apify.com/mambalabs/website-traffic-rank-estimator?fpr=mamba) | `GnOFUzlNVIoXgeJjH` |
| [Work Email Waterfall](https://apify.com/mambalabs/email-waterfall-orchestrator?fpr=mamba) | `OT6xqTFThC0Rjf7Zj` |
| [Workplace Program Detector](https://apify.com/mambalabs/workplace-program-detector?fpr=mamba) | `Li6pPDhqbdzFz3h7G` |
| [X Brand Presence Mapper](https://apify.com/mambalabs/x-brand-presence-mapper?fpr=mamba) | `oLOgadhHUkNAyDA3w` |
| [YouTube Channel and Video List Scraper](https://apify.com/mambalabs/youtube-video-channel-scraper?fpr=mamba) | `txaAjeBqgj5MStFE4` |
| [YouTube Channel Email Finder](https://apify.com/mambalabs/youtube-channel-email-finder?fpr=mamba) | `IDgKZcmeeuunUbccN` |
| [YouTube Channel from Company Domain](https://apify.com/mambalabs/youtube-channel-transcript-extractor?fpr=mamba) | `6hSpD3kd2s2IQ4VSs` |
| [Zillow Listing Details](https://apify.com/mambalabs/zillow-listing-details?fpr=mamba) | `yG4zM0Enfsw2NefJ1` |

Built by [Mamba Labs](https://apify.com/mambalabs).

# Actor input Schema

## `mode` (type: `string`):

read (default): the sheet becomes one dataset row per sheet row. append: add rows after the last row. replace: clear the tab, then write the rows. upsert: overwrite the rows whose key_column value is already in the sheet and add the rest. The three write modes need a credential below.

## `spreadsheet` (type: `string`):

The Google Sheets URL as copied from the browser, or the spreadsheet ID. A #gid= in the URL picks that tab.

## `sheet` (type: `string`):

Optional. The tab name, or its gid number. Default: the gid in the URL, else the first tab. In a write mode a tab name that does not exist is created.

## `range` (type: `string`):

Optional, read mode. An A1 range without the tab name, for example A1:F500 or B:D. Default: the whole tab.

## `header_row` (type: `string`):

true (default) or false. When true, read rows are keyed by the header row, and writes match your row keys to the header columns and add new columns at the end. When false, read rows are keyed by column letter and writes go column by column in key order.

## `dataset_id` (type: `string`):

Write modes. The Apify dataset whose items go into the sheet, for example the default dataset of another run. In an Apify integration, pass the triggering run's resource.defaultDatasetId variable. Fields starting with # are skipped.

## `rows` (type: `array`):

Write modes, instead of a dataset. A JSON list of objects, one per sheet row, for example \[{"name": "Ann", "email": "ann@example.com"}].

## `columns` (type: `array`):

Optional, write modes. Only these keys are written, in this order. Default: every key in the rows, in first seen order.

## `key_column` (type: `string`):

Upsert mode. The column whose value identifies a row, for example email or url. A row whose value is already in that column is overwritten in place; the rest are added. Rows with no value in it are skipped.

## `value_input` (type: `string`):

raw (default): every value is stored exactly as given, so text starting with = is not run as a formula. user_entered: Google parses values as if typed, so formulas run and dates and numbers are converted.

## `max_rows` (type: `string`):

Most rows to read or write in this run, 1 to 1,000,000 (default 100,000).

## `service_account_json` (type: `string`):

Your own service account key file, pasted whole. Share the spreadsheet with its client_email as an Editor (Viewer to read). It is sent only to Google and is never stored, logged, or written to a row.

## `oauth_refresh_token` (type: `string`):

Instead of a service account: a refresh token from your own Google OAuth client with the spreadsheets scope. Needs oauth_client_id and oauth_client_secret from the same client.

## `oauth_client_id` (type: `string`):

The client ID that issued the refresh token.

## `oauth_client_secret` (type: `string`):

The client secret that issued the refresh token.

## `oauth_access_token` (type: `string`):

Instead of the above: a current OAuth access token with the spreadsheets scope. It expires in about an hour, so it suits a single run.

## `max_charge_usd` (type: `string`):

Optional. The run stops before a charge that would pass this amount, and never writes a block of rows it could not charge. Summary rows are always returned.

## `source_tag` (type: `string`):

Internal attribution tag. Leave empty.

## Actor input object example

```json
{
  "mode": "read",
  "spreadsheet": "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit#gid=0",
  "header_row": "true",
  "value_input": "raw",
  "max_rows": "100000"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `run_summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "spreadsheet": "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit#gid=0"
};

// Run the Actor and wait for it to finish
const run = await client.actor("mambalabs/google-sheets-import-export").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "spreadsheet": "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit#gid=0" }

# Run the Actor and wait for it to finish
run = client.actor("mambalabs/google-sheets-import-export").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "spreadsheet": "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit#gid=0"
}' |
apify call mambalabs/google-sheets-import-export --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mambalabs/google-sheets-import-export"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/0VT1IaI5S3lIllONL/builds/7QwanQIHv97ic0KSt/openapi.json
