# Apify Dataset to Google Sheets Sync (`zentrafoundry/apify-dataset-to-google-sheets-sync`) Actor

Send bounded Apify dataset rows to a buyer-controlled Google Sheets webhook endpoint.

- **URL**: https://apify.com/zentrafoundry/apify-dataset-to-google-sheets-sync.md
- **Developed by:** [Zentra](https://apify.com/zentrafoundry) (community)
- **Categories:** Integrations, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 result delivereds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Apify Dataset to Google Sheets Sync

Send bounded Apify dataset rows to a buyer-controlled Google Sheets webhook endpoint.

### What this Actor does

Read rows from a supplied dataset or input array, map and batch them, then return an auditable delivery summary.

- Copy bounded Actor output into Google Sheets.
- Map selected fields before delivery.
- Review delivered and rejected row counts.

### Who this is for

Operations teams, Analysts, Automation builders.

### Input

- Demo mode is the safe default and emits one deterministic fixture.
- Live mode processes at most `maxItems` configured inputs.
- `sourceDatasetId` or `items`: bounded source rows.
- `destinationWebhookUrl`: buyer-controlled HTTPS endpoint, treated as secret.
- `fieldMap` and `batchSize`: optional delivery controls.

### Output

The default dataset uses the Actor-specific schema in `.actor/DATASET_SCHEMA.json`. Key fields include `sourceDatasetId`, `attemptedRows`, `deliveredRows`, `rejectedRows`, `batchCount`, `destinationType`, `fieldMapApplied`, plus exact source, status, delta, confidence, warning, and fixture/live labels.

### Data sources

- `APIFY-DATASETS`
- `GOOGLE-SHEETS`

These are the registered catalog source IDs. Live inputs may also include buyer-provided inline rows and a buyer-controlled HTTPS delivery endpoint; buyer inputs and credentials are not registered source IDs.

### Demo run

Run `examples/first-run.json`. The row in `examples/sample-output.json` is labeled `sourceStatus: fixture`, `isDemo: true`, and is not live evidence.

### Live-run behavior

Live mode processes only the configured Actor-specific inputs. Failures are returned as diagnostics or explicit errors; the runtime does not silently substitute unrelated source families.

### Pricing

The runtime reads the effective Apify pay-per-event map after `Actor.init()` and adapts between the verified export-delivery and result-delivery events. It stops with an explicit configuration-drift error instead of emitting unmetered output. This package never defines or changes provider pricing.

### Identity and visibility safety

This package targets only `zentrafoundry/apify-dataset-to-google-sheets-sync` with Actor ID `t5CY8JU1efkV8k5cN`. Any future release must find exactly one authenticated inventory match and abort on identity or visibility drift. Creating, cloning, upserting, duplicating, drafting, or privatizing the Actor is forbidden.

### Limitations

- Live delivery requires a buyer-controlled HTTPS endpoint configured for the target Sheet.
- The Actor does not create Google credentials or log the destination URL.
- Local tests and fixtures do not prove an Apify build, live run, Store content update, or Store readback.

### Responsible use

Use only data you are authorized to process. Respect source terms, robots policies, privacy rules, and applicable law. Never place credentials, cookies, tokens, or private account data in URLs or logs.

### Support

When reporting a problem, include the run ID, sanitized input shape, expected result, and observed result. Do not include secrets or private data.

# Actor input Schema

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

Use demo for the deterministic fixture or live for configured inputs.

## `sourceMode` (type: `string`):

Use sample for the deterministic fixture or the Actor-specific configured input mode.

## `outputMode` (type: `string`):

Fixture output is explicitly labeled and does not represent a live observation.

## `maxItems` (type: `integer`):

Hard upper bound for inputs processed in this run.

## `sourceDatasetId` (type: `string`):

Existing dataset to read when inline rows are not supplied.

## `items` (type: `array`):

Optional rows used instead of a dataset ID.

## `destinationWebhookUrl` (type: `string`):

Buyer-controlled HTTPS Apps Script or compatible endpoint. It is never written to output or logs.

## `fieldMap` (type: `object`):

Optional output-column to input-field mapping.

## `batchSize` (type: `integer`):

Rows sent per HTTPS request.

## Actor input object example

```json
{
  "mode": "demo",
  "sourceMode": "sample",
  "outputMode": "sample-records",
  "maxItems": 1,
  "items": [],
  "fieldMap": {},
  "batchSize": 50
}
```

# Actor output Schema

## `results` (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 = {
    "mode": "demo",
    "sourceMode": "sample",
    "outputMode": "sample-records",
    "maxItems": 1,
    "items": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("zentrafoundry/apify-dataset-to-google-sheets-sync").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 = {
    "mode": "demo",
    "sourceMode": "sample",
    "outputMode": "sample-records",
    "maxItems": 1,
    "items": [],
}

# Run the Actor and wait for it to finish
run = client.actor("zentrafoundry/apify-dataset-to-google-sheets-sync").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "mode": "demo",
  "sourceMode": "sample",
  "outputMode": "sample-records",
  "maxItems": 1,
  "items": []
}' |
apify call zentrafoundry/apify-dataset-to-google-sheets-sync --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=zentrafoundry/apify-dataset-to-google-sheets-sync",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/t5CY8JU1efkV8k5cN/builds/8HLpID4kXeXvBVPsb/openapi.json
