# Google Sheets Export: safe append, no Google login (`silken_dunite/google-sheets-export`) Actor

Export Apify results to Google Sheets by sharing the sheet with one email address. New rows go below your data, duplicates can be skipped, and the rows and columns you already have are never changed.

- **URL**: https://apify.com/silken_dunite/google-sheets-export.md
- **Developed by:** [Silken Dunite](https://apify.com/silken_dunite) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 1,000 rows written to your sheet

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/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 Export: safe append, no Google login

Sends your Apify results to a Google Sheet. You share the sheet with one email address, paste its link, and run. New rows go below what is already there. Nothing you wrote before is moved, rewritten or reformatted.

### Setup

1. In Google Sheets, click **Share** and add **sheets-export@ultimate-walker-516314-d7.iam.gserviceaccount.com** as **Editor**.
2. Paste the sheet link from the address bar into **Spreadsheet link**, choose a dataset, and start the run.

There is no Google sign-in screen and no login that expires.

To export after every scraper run, open your scraper, go to **Integrations**, connect this Actor, and leave **Dataset** empty. It reads each run's results on its own.

### What it does

New rows are added below your data. Existing rows are never overwritten. If two scrapers finish at the same moment, both sets of rows arrive.

Set **Skip rows already in the sheet** to a field that is unique for each item, such as `url`, and a scheduled run adds only the items the sheet does not have yet.

Your layout stays as you made it. Column order, extra columns like "My notes", and a title row above the header are left alone. A field the sheet has not seen before becomes a new column on the right.

Text stays text. `00123`, `+56 9 1234 5678`, long order IDs and titles that start with `=` are written exactly as scraped. They are not turned into numbers or formulas.

You can export only some fields, rename columns (`price` to `Price (USD)`), add an "Added at" timestamp, and write to any tab. A tab that does not exist yet is created.

Only the new rows are sent to Google. Adding 5 rows to a 20,000-row sheet sends about 0.2 KB.

When something is wrong, the run says what to do, for example "share the sheet with … as Editor", instead of a stack trace.

### Input

| Field | What it's for |
|---|---|
| Spreadsheet link | The link to your sheet. Any format works, including just the ID. |
| Tab name | Optional. Defaults to the tab in your link, or the first tab. |
| Dataset | The results to export. Leave empty when used as an integration. |
| Raw data | Instead of a dataset: a JSON list of objects. |
| Mode | **Add new rows below** (default) or **Replace everything in the tab**. |
| Skip rows already in the sheet | A unique field (e.g. `url`). Items already in that column are skipped. |
| Only these fields | Export only these fields, in this order. |
| Rename columns | e.g. `{"price": "Price (USD)"}` |
| Add a timestamp column | Adds the time each row was added (UTC). |
| Lists | `["red","blue"]` as one cell `red, blue` (default), or one column each. |

Nested data is flattened like Apify's own CSV export: `address/city`, `reviews/0/stars`.

### Output

One summary item per run: rows written, duplicates skipped, new columns, and a link to the sheet.

### Pricing

- USD 0.30 per 1,000 rows added to your sheet.
- USD 0.002 per run, at the default 256 MB of memory.
- Skipped duplicates cost nothing. Platform usage is included.

You can set a maximum cost on any run. The tool stops writing when it reaches it.

### FAQ

**Why share the sheet with an email address instead of signing in with Google?**
Because it keeps working. There is no sign-in to expire and no Google warning screen. The tool can open only the sheets you share with it.

**Can someone else write to my sheet through this tool?**
No. The first Apify account that writes to a sheet becomes its owner, and other accounts are refused. To use a sheet from another account, make a copy of it.

**My company requires our own Google account.**
Paste your own service account key under **Advanced** and share the sheet with that account instead.

**Can Replace mode leave me with an empty sheet?**
No. It writes the new data first and clears leftovers only after that succeeds. If the run's maximum cost is too low to write everything, it does not start, and your sheet stays as it was.

**Limits?**
Google allows about 60 writes per minute. When Google answers "too many requests", the tool waits and tries again.

# Actor input Schema

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

Paste the link of your Google Sheet, straight from the address bar. Then click Share in Google Sheets and add sheets-export@ultimate-walker-516314-d7.iam.gserviceaccount.com as Editor. That's the only setup: no Google login needed.

## `sheetName` (type: `string`):

Which tab to write to. Leave empty to use the tab in your link (or the first tab). If the tab doesn't exist yet, it's created.

## `datasetId` (type: `string`):

The results to export. When you use this tool as an integration after another Actor, leave it empty: it picks up that run's results automatically.

## `rawData` (type: `array`):

Instead of a dataset, paste JSON: a list of objects, or a list of rows where the first row is the header.

## `limit` (type: `integer`):

Export at most this many items from the dataset. Empty = all.

## `offset` (type: `integer`):

Skip this many items at the start of the dataset.

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

Add new rows below what's already there, or replace the tab's contents.

## `dedupeField` (type: `string`):

Enter a field that's unique for each item, like url or id. Items whose value is already in that column are skipped, so scheduled runs only add what's new.

## `fields` (type: `array`):

Export only these fields, in this order. A field also brings its nested parts (address brings address/city). Empty = all fields.

## `renameColumns` (type: `object`):

Friendly column names, like {"price": "Price (USD)", "title": "Product"}.

## `addTimestamp` (type: `boolean`):

Add the date and time (UTC) each row was added.

## `timestampColumn` (type: `string`):

Name of the timestamp column.

## `arrayMode` (type: `string`):

How to write lists like \["red", "blue"]. Lists of objects always get one column per field.

## `serviceAccountJson` (type: `string`):

Only if your company requires its own Google account: paste a service account JSON key and share the sheet with that account instead. It's stored encrypted.

## Actor input object example

```json
{
  "spreadsheet": "https://docs.google.com/spreadsheets/d/PASTE_YOUR_SHEET_ID/edit",
  "offset": 0,
  "mode": "append",
  "addTimestamp": false,
  "timestampColumn": "Added at",
  "arrayMode": "join"
}
```

# Actor output Schema

## `summary` (type: `string`):

Rows written, duplicates skipped, new columns, and the sheet link.

# 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/PASTE_YOUR_SHEET_ID/edit"
};

// Run the Actor and wait for it to finish
const run = await client.actor("silken_dunite/google-sheets-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/PASTE_YOUR_SHEET_ID/edit" }

# Run the Actor and wait for it to finish
run = client.actor("silken_dunite/google-sheets-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/PASTE_YOUR_SHEET_ID/edit"
}' |
apify call silken_dunite/google-sheets-export --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,silken_dunite/google-sheets-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/NLrhiE8V9rlx8EbAw/builds/kNwbtw6glPc4oZ6Oc/openapi.json
