# Airtable (apify/airtable) (`apify/airtable-apify-airtable`) Actor

Imports any Apify dataset into Airtable with append, override, or create modes. Supports custom field mapping, automatic column creation, duplicate detection, batching, retries, and OAuth. Works standalone or as an Actor-to-Actor integration.

- **URL**: https://apify.com/apify/airtable-apify-airtable.md
- **Developed by:** [Apify](https://apify.com/apify) (Apify)
- **Categories:** Automation, Integrations
- **Stats:** 95 total users, 26 monthly users, 82.8% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## Airtable Data Import Actor

Airtable Data Import Actor imports data from Apify datasets directly into Airtable with flexible field mapping, duplicate detection, and automatic table/field creation.

### What does Airtable Data Import Actor do?

This Actor imports data from any Apify dataset into your Airtable base. Perfect for storing web scraping results, building automated data pipelines, and creating structured databases from scraped data.

- **Flexible import modes**: Append, override, or create tables automatically
- **Smart field mapping**: Map dataset fields to Airtable columns with dot notation support (e.g., `product.details.price`)
- **Duplicate detection**: Skip records that already exist based on a unique identifier
- **Automatic field creation**: Create new Airtable fields on the fly
- **Batch processing**: Handles large datasets with automatic batching

### Examples of Airtable Data Import Actor workflow

1. Run a web scraper Actor to collect data
2. Set Airtable Data Import Actor as an integration with `datasetId: {{resource.defaultDatasetId}}`
3. Data automatically flows from Airtable Data Import Actor to Airtable

### How to use Airtable Data Import Actor

#### ⚠️ Use the Apify extension for Airtable

**For the best experience, we recommend using the [Apify extension for Airtable](https://docs.apify.com/platform/integrations/airtable)**. The extension provides:

- **Visual field mapping UI**: Map dataset fields directly within Airtable
- **Automatic field matching**: Matches source and target fields
- **Run Actors from Airtable**: Execute Actors and tasks without leaving your base
- **OAuth integration**: Simple authentication flow

Install it directly in Airtable: **Tools > Extensions > Search "Apify"**

[Learn more about the Apify-Airtable integration →](https://docs.apify.com/platform/integrations/airtable)

#### 1. Connect Airtable account

Authenticate with Airtable using OAuth in the Apify integration settings.

#### 2. Configure import settings

#### Required fields

- **Airtable base**: Base ID (e.g., `appXXXXXXXXXXXXXX`) or base name (e.g., `My Base`)
  - **By ID**: Find the base ID in your Airtable URL
  - **By name**: Use the exact base name (case-insensitive matching)

- **Airtable table name**: Name of the target table (e.g., `Products`, `Contacts`)

- **Apify dataset ID**: Source dataset ID

  **⚠️ IMPORTANT FOR INTEGRATIONS:** When setting up this Actor as an integration to run after another Actor, use the following variable for the Dataset ID field:

  ```
  {{resource.defaultDatasetId}}

  ```

  This automatically uses the output dataset from the previous Actor in your workflow.

- **Import operation**:
  - `Append` - Add new records (keeps existing data)
  - `Override` - Delete all records first, then import
  - `Create` - Create a table if it doesn't exist yet

- **Field mappings**: Map source fields to Airtable columns

  ```json
  [
      {
          "source": "title",
          "target": "Product Name",
          "targetType": "existing",
          "fieldType": "singleLineText"
      },
      {
          "source": "price",
          "target": "Price",
          "targetType": "new",
          "fieldType": "number"
      }
  ]

  ```

#### Optional fields

- **Unique ID source field**: Field name for duplicate detection (e.g., `url`, `productId`)
- **Clear existing table data**: Clear existing data when the table already exists in `Create` mode

#### Field mapping guide

Each mapping requires:

- **source**: Dataset field name (supports dot notation: `contact.email`)
- **target**: Airtable column name
- **targetType**: `existing` (field exists) or `new` (create if missing)
- **fieldType**: `singleLineText`, `multilineText`, `number`, or `checkbox`

### Example: E-commerce product import

```json
{
    "operation": "Append",
    "base": "appABC123456789",
    "table": "Products",
    "datasetId": "{{resource.defaultDatasetId}}",
    "uniqueId": "url",
    "dataMappings": [
        {
            "source": "title",
            "target": "Product Name",
            "targetType": "existing",
            "fieldType": "singleLineText"
        },
        {
            "source": "price",
            "target": "Price",
            "targetType": "existing",
            "fieldType": "number"
        },
        {
            "source": "url",
            "target": "URL",
            "targetType": "existing",
            "fieldType": "singleLineText"
        }
    ]
}

```

#### Tips

- Always use a unique identifier field (`uniqueId`) when appending to prevent duplicates
- Use `singleLineText` for most text fields, `multilineText` for descriptions
- Airtable Data Import Actor processes datasets in batches of 1000 items automatically
- Check Actor logs for detailed progress and error information

### Output

Returns a summary with the imported count, skipped duplicates, and operation details.

# Actor input Schema

## `oAuthAccount.BpW1howJtlI9fdEck` (type: `string`):

Connect your Airtable using OAuth2.

## `operation` (type: `string`):

How to handle records in the target Airtable table before importing. 'Append' keeps existing records and adds new ones. 'Override' deletes all existing records first, then imports. 'Create' will create the table if it does not exist, otherwise it behaves like 'Append'.

## `clearOnCreate` (type: `boolean`):

Only applies when operation is 'Create'. If true and the table already exists, all existing records will be deleted before importing (similar to 'Override' mode). If false and the table already exists, an error will be thrown. If the table does not exist, it will be created regardless of this setting.

## `base` (type: `string`):

The ID or name of the Airtable base where data will be imported (for example: appXXXXXXXXXXXXXX).

## `table` (type: `string`):

Name of the Airtable table to import into. If operation is 'Create' and this table does not exist, the Actor will try to create it (if Airtable permissions and APIs allow).

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

Select a dataset

## `uniqueId` (type: `string`):

Source field (using dot notation, e.g. 'url' or 'metadata.headers.age') used to detect duplicates. If provided, the Actor reads the mapped target field in Airtable and skips records whose ID already exists there.

## `dataMappings` (type: `array`):

List of mappings from Apify dataset fields (source) to Airtable fields (target). 'source' uses dot notation (e.g. 'metadata.headers.age'), 'target' is the Airtable field name. 'targetType' is 'existing' or 'new'. 'fieldType' describes the Airtable field type (e.g. 'singleLineText', 'multilineText', 'number').

## Actor input object example

```json
{
  "operation": "Append",
  "clearOnCreate": false
}
```

# Actor output Schema

## `importSummary` (type: `string`):

Detailed summary of the import operation including statistics, timing, and metadata

# 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("apify/airtable-apify-airtable").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("apify/airtable-apify-airtable").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 '{}' |
apify call apify/airtable-apify-airtable --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/f4DM1wGmMQdnTLbrE/builds/P01U1dyUWVdPdEeKB/openapi.json
