> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-toolre-1772123259-dfebfdb.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AirtableLoader integration

> Integrate with the AirtableLoader document loader using LangChain JavaScript.

The `AirtableLoader` class provides functionality to load documents from Airtable tables. It supports two main methods:

1. `load()`: Retrieves all records at once, ideal for small to moderate datasets.
2. `loadLazy()`: Fetches records one by one, which is more memory-efficient for large datasets.

## Prerequisites

Ensure that your Airtable API token is available as an environment variable:

```typescript theme={null}
process.env.AIRTABLE_API_TOKEN = "YOUR_AIRTABLE_API_TOKEN";
```

## Usage

```typescript theme={null}
import { AirtableLoader } from "@langchain/community/document_loaders/web/airtable";
import { Document } from "@langchain/core/documents";

// Default airtable loader
const loader = new AirtableLoader({
  tableId: "YOUR_TABLE_ID",
  baseId: "YOUR_BASE_ID",
});

try {
  const documents: Document[] = await loader.load();
  console.log("Loaded documents:", documents);
} catch (error) {
  console.error("Error loading documents:", error);
}

// Lazy airtable loader
const loaderLazy = new AirtableLoader({
  tableId: "YOUR_TABLE_ID",
  baseId: "YOUR_BASE_ID",
});

try {
  console.log("Lazily loading documents:");
  for await (const document of loader.loadLazy()) {
    console.log("Loaded document:", document);
  }
} catch (error) {
  console.error("Error loading documents lazily:", error);
}

// Airtable loader with specific view
const loaderView = new AirtableLoader({
  tableId: "YOUR_TABLE_ID",
  baseId: "YOUR_BASE_ID",
  kwargs: { view: "YOUR_VIEW_NAME" },
});

try {
  const documents: Document[] = await loader.load();
  console.log("Loaded documents with view:", documents);
} catch (error) {
  console.error("Error loading documents with view:", error);
}
```

***

<Callout icon="edit">
  [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/javascript/integrations/document_loaders/web_loaders/airtable.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
</Callout>

<Callout icon="terminal-2">
  [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
</Callout>
