# Dataset Export to S3, GCS, Azure, SFTP & Airtable (`gazidev/dataset-cloud-export`) Actor

Export any Apify dataset to your own S3, R2, MinIO, Google Cloud Storage, Azure Blob, SFTP or FTP as CSV, JSON, JSONL, Excel or Parquet (gzip, split, path templates), or upsert it into Airtable or Postgres. Use after any scraper. Free preview.

- **URL**: https://apify.com/gazidev/dataset-cloud-export.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 file 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/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

## Dataset Export to S3, GCS, Azure, SFTP & Airtable

Export any **Apify dataset** to **your own storage** in one step: **Amazon S3**, **Cloudflare R2**, **MinIO**, **Backblaze B2**, **Wasabi**, **Google Cloud Storage**, **Azure Blob Storage**, **SFTP** or **FTP/FTPS** as **CSV, JSON, JSON Lines, Excel (XLSX) or Parquet**. You can also **upsert the rows into Airtable** or **Postgres / Supabase / Neon**.

Add it as an integration after any scraper. Every finished run then lands in your bucket, your SFTP drop folder or your Airtable base automatically, with no code and no glue scripts.

### What it does

- **One Actor for all destinations:** S3 and S3-compatible stores (R2, MinIO, B2, Wasabi, DigitalOcean Spaces), GCS, Azure Blob, SFTP, FTP/FTPS, Airtable, Postgres and the Apify key-value store.
- **Five file formats:**
  - CSV, with a delimiter option and an optional UTF-8 BOM for Excel.
  - JSON array.
  - JSON Lines / NDJSON.
  - Excel XLSX, with a styled header, frozen first row and autofilter.
  - Parquet (snappy), with column types inferred: int64, double, bool and string.
- **File handling:**
  - Optional **gzip**.
  - **Split every N rows**.
  - **File path templates** such as `exports/{actorName}/{date}/{datasetId}{part}.{ext}`.
  - Folders are created automatically.
- **Choose columns:**
  - Pick fields with dot paths (`rating.stars`).
  - Drop fields.
  - Rename fields with a field map.
  - Nested objects are flattened to `a.b` columns for CSV, XLSX and Parquet.
- **Airtable upsert:**
  - Uses `performUpsert` on 1–3 merge fields, so existing records are updated and new ones created.
  - Sends batches of 10 (the Airtable limit) and stays under 5 requests/s.
  - Values are typecast to your field types.
- **Postgres / Supabase upsert:**
  - `INSERT ... ON CONFLICT DO UPDATE` on your key.
  - Optionally creates the table, with column types inferred and objects stored as `jsonb`.
  - Only writes fields that match columns.
- **Only new items:** the Actor remembers how far a growing dataset was exported and delivers only the rows added since the last run.
- **Free preview:** run it without credentials and you see exactly which files or records would be delivered (paths, rows, bytes, the first rows). Nothing is uploaded and nothing is charged. **Dry run** does the same with your real settings.
- **Delivery log:** one dataset row per delivered file, with the location, rows, bytes, MD5, SHA-256 and ETag. Errors are listed per file.

### Use cases

- Land scraped data in an **S3 / R2 data lake** as Parquet for Athena, BigQuery, Snowflake, DuckDB or Databricks.
- Send **daily CSV files to a client's SFTP drop folder**, which agencies and B2B data deliveries often need.
- Keep an **Airtable base** in sync with a scraper: price lists, lead lists, job boards, real-estate listings.
- Upsert scraper output into **Supabase / Postgres** tables that power your app.
- Archive every run of a scheduled Actor to **Azure Blob** or **GCS** with dated paths.

### How to use it after another Actor (integration)

1. Open the scraper you want to export from. Go to **Integrations**, choose **Connect Actor or task**, and pick **Dataset Export to S3, GCS, Azure, SFTP & Airtable**.
2. In the input, set **Dataset ID** to `{{resource.defaultDatasetId}}`.
3. Choose the destination, the format and your credentials. Credentials are stored encrypted as secret inputs.
4. Every successful run of the scraper is now exported automatically.

You can also run it by hand with any dataset ID, or with the `username~dataset-name` form for named datasets.

### Input example (S3, Parquet, split)

```json
{
  "datasetId": "{{resource.defaultDatasetId}}",
  "destination": "s3",
  "format": "parquet",
  "splitEvery": 100000,
  "filenameTemplate": "lake/{actorName}/dt={date}/{sourceRunId}{part}.{ext}",
  "s3Bucket": "my-data-lake",
  "s3Region": "eu-central-1",
  "s3AccessKeyId": "AKIA...",
  "s3SecretAccessKey": "..."
}
```

**Cloudflare R2 / MinIO / B2:** also set `s3EndpointUrl`, for example `https://<accountid>.r2.cloudflarestorage.com`, with region `auto` for R2.

### Input example (Airtable upsert)

```json
{
  "datasetId": "{{resource.defaultDatasetId}}",
  "destination": "airtable",
  "airtableToken": "pat...",
  "airtableBaseId": "appXXXXXXXXXXXXXX",
  "airtableTable": "Products",
  "upsertKey": ["SKU"],
  "fieldMap": {"sku": "SKU", "title": "Name", "price": "Price", "rating.stars": "Stars"}
}
```

With a field map and no "Fields to export", only the mapped fields are sent. Airtable rejects field names that are not in your table, so map the scraper's fields to your column names.

### Output example

One row per delivered file:

```json
{
  "destination": "s3",
  "status": "delivered",
  "target": "apify/my-scraper/2026-11-03/aBcD123-part-0001.csv.gz",
  "url": "s3://my-bucket/apify/my-scraper/2026-11-03/aBcD123-part-0001.csv.gz",
  "format": "csv",
  "gzip": true,
  "part": 1,
  "rows": 1000,
  "bytes": 16689,
  "md5": "72216f64b354638d29cc1588db040730",
  "etag": "dc32e926b5a06319d8d6442a2e8ba31f",
  "deliveredAt": "2026-11-03T12:14:52Z",
  "error": null
}
```

For Airtable and Postgres you get one summary row instead: records written, created, updated and failed. Any ignored columns are listed too. The key-value store record `OUTPUT` holds the run summary: rows, files, errors, charges and the only-new cursor.

### File path placeholders

| Placeholder | Value |
|---|---|
| `{actorName}` | Name of the Actor that produced the dataset |
| `{datasetId}` / `{datasetName}` | Source dataset ID / name |
| `{sourceRunId}` / `{runId}` | Source run ID / this export run's ID |
| `{date}` `{year}` `{month}` `{day}` | UTC date parts |
| `{time}` `{datetime}` `{timestamp}` | `HHMMSS`, `YYYYMMDD-HHMMSS`, Unix seconds |
| `{part}` | `-part-0001`, ... when files are split, otherwise empty |
| `{ext}` | `csv`, `json`, `jsonl`, `xlsx`, `parquet` (+ `.gz`) |

### Pricing (pay per event)

| Event | Price |
|---|---|
| File delivered (S3, R2, GCS, Azure, SFTP, FTP, key-value store) | **$0.003** per file |
| Rows exported | $0.0005 per started 1,000 rows in a file |
| Record written to Airtable / Postgres | $0.0002 per record |
| Actor start | $0.00005 |

Example costs:

- 10,000 rows as one CSV to S3 cost **$0.008**.
- 1,000 Airtable upserts cost **$0.20**.

Preview runs, dry runs and failed uploads are **free**. Set a max cost per run and the Actor stops cleanly before it is exceeded.

| Actor | Destinations | Price |
|---|---|---|
| **This Actor** | S3, R2, MinIO, GCS, Azure, SFTP, FTP, Airtable, Postgres, KV store | $0.003/file + $0.0005/1k rows; $0.0002/record |
| apify/s3-uploader | S3 only | free |
| apify/airtable-apify-airtable | Airtable only | free |
| charlesmarkette dataset delivery | SFTP, FTP, Dropbox, Drive | $0.0045/file |
| alaudinburki dataset-to-airtable | Airtable only | $0.001/row |

### Security

- Credentials go into **secret input fields**. Apify stores them encrypted, and they are never logged or written to the output; error messages are scrubbed.
- Use **least-privilege keys**:
  - **S3:** a key allowed only `s3:PutObject` on one bucket or prefix. `s3:ListBucket` is optional.
  - **GCS:** a service account with `roles/storage.objectCreator` on one bucket.
  - **Azure:** a container SAS URL with create and write rights only.
  - **Airtable:** a personal access token with only `data.records:write`, limited to one base.
  - **Postgres:** a user with INSERT and UPDATE rights on one table.
- **SFTP:** set the host key fingerprint (`SHA256:...`) to reject servers you do not expect.

### FAQ

**Does it work as a webhook / integration?**
Yes. Use `{{resource.defaultDatasetId}}` as the Dataset ID. A raw webhook payload containing `resource.defaultDatasetId` is understood too.

**What happens without credentials?**
You get a free preview. The dataset shows the file paths, row counts, sizes and first rows that would be delivered.

**How big can a dataset be?**
Rows are streamed to disk, so CSV, JSON and JSONL work with millions of rows. XLSX and Parquet hold one file part in memory, so use **Split every N rows** (for example 200,000) for very large datasets, or give the run more memory. XLSX is split automatically at Excel's 1,048,575-row limit.

**Does "only new items" work with webhooks?**
Each scraper run has its own new dataset, so you do not need it there. Use it for scheduled exports of one **named** dataset that keeps growing. The cursor only moves after a successful delivery.

**Are existing files overwritten?**
Yes, an upload to the same path replaces the file. The default template includes the time (`{time}`), so runs do not overwrite each other.

**Can I write to Google Drive or Dropbox?**
Not yet. Use S3, GCS or SFTP, or open an issue if you need another destination.

### Use with AI agents (Apify MCP)

This Actor works as a tool in the [Apify MCP server](https://mcp.apify.com). An AI agent can scrape with any Actor and then call `gazidev/dataset-cloud-export` with the run's `defaultDatasetId` to save the result to the user's bucket or Airtable base. Agents can also send `items` directly, as a JSON array, without a dataset. Run with `"dryRun": true` first to show the user what would be written.

# Actor input Schema

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

The Apify dataset to export (ID or "username~dataset-name"). In a "Run Actor" integration / webhook after another Actor, use {{resource.defaultDatasetId}}. A raw webhook payload with resource.defaultDatasetId also works. Leave empty to try the Actor with 5 sample rows.

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

Optional: a JSON array of objects to export directly (handy for AI agents and quick tests). Ignored when a dataset is set.

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

Export at most this many items (0 = all).

## `onlyNewItems` (type: `boolean`):

Remember how far this dataset was exported to this destination and only deliver items added since (datasets are append-only). Useful for scheduled runs on a named dataset that keeps growing. The cursor moves only after a successful delivery.

## `stateStoreName` (type: `string`):

Named key-value store that keeps the only-new cursors.

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

Only these fields, in this order (dot paths like "rating.stars" or "images.0" allowed). Empty = all fields.

## `omit` (type: `array`):

Fields to remove (dot paths allowed).

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

Rename fields: {"source.path": "Target column"}. For Airtable these must be your table's field names. If "Fields to export" is empty, only the mapped fields are exported.

## `skipHiddenFields` (type: `boolean`):

Drop fields whose name starts with # (Apify convention for internal fields).

## `destination` (type: `string`):

Where to deliver the data. Without connection details the run is a free PREVIEW: nothing is uploaded or charged, the dataset shows what would be delivered.

## `dryRun` (type: `boolean`):

Build the files / records and validate the settings, but do not upload or write anything. Never charged.

## `format` (type: `string`):

File format for the file destinations. CSV, XLSX and Parquet flatten nested objects into dot-notation columns (rating.stars). Ignored for Airtable / Postgres.

## `filenameTemplate` (type: `string`):

Path of each file inside the bucket / container / server. Placeholders: {actorName} (Actor that produced the dataset), {datasetId}, {datasetName}, {sourceRunId}, {runId}, {date} (YYYY-MM-DD), {year}, {month}, {day}, {time} (HHMMSS), {datetime}, {timestamp}, {part} (-part-0001 when split), {ext}. Folders are created as needed. For SFTP/FTP, relative paths start in the login directory.

## `gzip` (type: `boolean`):

Compress CSV / JSON / JSONL files (.gz). XLSX and Parquet are already compressed.

## `splitEvery` (type: `integer`):

Start a new file every N rows (0 = one file). Each file is one "file delivered" event.

## `csvDelimiter` (type: `string`):

Single character, or "tab".

## `csvBom` (type: `boolean`):

Add a byte-order mark so Excel opens UTF-8 CSV files correctly.

## `s3Bucket` (type: `string`):

Bucket name (no s3:// prefix).

## `s3Region` (type: `string`):

e.g. us-east-1, eu-central-1. "auto" for Cloudflare R2. Default us-east-1.

## `s3AccessKeyId` (type: `string`):

Stored encrypted. Use a key limited to s3:PutObject on this bucket (s3:ListBucket optional).

## `s3SecretAccessKey` (type: `string`):

Stored encrypted.

## `s3SessionToken` (type: `string`):

Only for temporary STS credentials.

## `s3EndpointUrl` (type: `string`):

Leave empty for AWS. Examples: https://<accountid>.r2.cloudflarestorage.com, https://s3.us-west-004.backblazeb2.com, https://minio.example.com:9000

## `s3Acl` (type: `string`):

e.g. bucket-owner-full-control or public-read. Empty = bucket default.

## `s3StorageClass` (type: `string`):

e.g. STANDARD_IA, INTELLIGENT_TIERING, GLACIER_IR. Empty = STANDARD.

## `gcsBucket` (type: `string`):

Bucket name (no gs:// prefix).

## `gcsServiceAccountJson` (type: `string`):

Full content of the service account JSON key file. Stored encrypted. Needs roles/storage.objectCreator (plus objectViewer to overwrite).

## `azureConnectionString` (type: `string`):

Storage account connection string (Access keys page). Stored encrypted.

## `azureContainer` (type: `string`):

Container name (used with the connection string).

## `azureContainerSasUrl` (type: `string`):

Alternative to the connection string: a container URL with a SAS token that allows create + write. Stored encrypted.

## `host` (type: `string`):

Server host name or IP.

## `port` (type: `integer`):

Default 22 for SFTP, 21 for FTP.

## `username` (type: `string`):

Login user.

## `password` (type: `string`):

Stored encrypted. For SFTP you can use a private key instead.

## `privateKey` (type: `string`):

OpenSSH / PEM private key (Ed25519, ECDSA or RSA), incl. BEGIN/END lines. Stored encrypted.

## `privateKeyPassphrase` (type: `string`):

Only if the key is encrypted.

## `sftpHostKeyFingerprint` (type: `string`):

e.g. SHA256:abc... (from ssh-keyscan | ssh-keygen -lf -). If set, the upload is refused when the server key does not match.

## `ftpTls` (type: `boolean`):

Use FTP over TLS (AUTH TLS) for FTP.

## `airtableToken` (type: `string`):

Create at airtable.com/create/tokens with scope data.records:write and access to the base. Stored encrypted.

## `airtableBaseId` (type: `string`):

Starts with "app" (from the base URL). Pasting the base URL also works.

## `airtableTable` (type: `string`):

Table name or ID (tbl...).

## `upsertKey` (type: `array`):

Airtable: 1-3 field names to match existing records (performUpsert) - matching records are updated, others created. Postgres: key columns for INSERT ... ON CONFLICT DO UPDATE (primary key when the table is created). Empty = always insert / create.

## `airtableTypecast` (type: `boolean`):

Let Airtable convert text to select options, numbers, dates, etc.

## `airtableApiUrl` (type: `string`):

Only change for a proxy.

## `postgresUrl` (type: `string`):

postgresql://user:password@host:5432/db?sslmode=require (Supabase: Session pooler string). Stored encrypted.

## `postgresTable` (type: `string`):

Table name, optionally schema.table. Only fields that match existing columns are written.

## `postgresCreateTable` (type: `boolean`):

Create the table with columns and types inferred from the first batch (objects/arrays as jsonb), with the upsert key as primary key.

## `kvsName` (type: `string`):

For destination "Apify key-value store": named store to keep files (kept forever). Empty = this run's store.

## `gcsEndpointUrl` (type: `string`):

Only for GCS emulators.

## Actor input object example

```json
{
  "maxItems": 0,
  "onlyNewItems": false,
  "stateStoreName": "dataset-cloud-export-state",
  "skipHiddenFields": true,
  "destination": "s3",
  "dryRun": false,
  "format": "csv",
  "filenameTemplate": "apify/{actorName}/{date}/{datasetId}-{time}{part}.{ext}",
  "gzip": false,
  "splitEvery": 0,
  "csvDelimiter": ",",
  "csvBom": false,
  "ftpTls": false,
  "airtableTypecast": true,
  "airtableApiUrl": "https://api.airtable.com",
  "postgresTable": "apify_items",
  "postgresCreateTable": true
}
```

# Actor output Schema

## `deliveries` (type: `string`):

No description

## `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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/dataset-cloud-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 = {}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gazidev/dataset-cloud-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/h9IGr8XA4nQITlRYs/builds/HjZuzBjzxfhYnpcxC/openapi.json
