Overview
Apify is a cloud platform for web scraping and data extraction, which provides an ecosystem of more than 10,000 ready-made apps called Actors for various web scraping, crawling, and data extraction use cases. This guide shows how to load documents from an Apify Dataset — a scalable append-only storage built for storing structured web scraping results, such as a list of products or Google SERPs, and then export them to various formats like JSON, CSV, or Excel. Datasets are typically used to save results of different Actors. For example:- Website Content Crawler Actor deeply crawls websites such as documentation, knowledge bases, help centers, or blogs, and stores the text content of webpages into a dataset
- RAG Web Browser Actor queries Google Search, scrapes the top N pages from the results, and returns the cleaned content in Markdown format for further processing by a large language model
Integration details
| Class | Package | Local | Serializable | PY support |
|---|---|---|---|---|
| ApifyDatasetLoader | @langchain/community | ❌ | ❌ | ✅ |
Loader features
| Source | Document Lazy Loading | Native Async Support |
|---|---|---|
| Apify Dataset | ❌ | ❌ |
Setup
Credentials
You’ll need to sign up for an Apify account and retrieve your Apify API token. Set it as an environment variable:Installation
You’ll first need to install the official Apify client and LangChain packages:npm
Pricing
Many Actors support Pay-Per-Event (PPE) pricing, where you pay for explicit events defined by the Actor author (for example, per dataset item). This can be a good fit for agent workloads where you want clear, per-operation costs. Apify also offers pay-per-use pricing with a free tier available. Pricing varies by Actor – some Actors are free (you only pay for platform usage), while others charge per result or event. See Apify pricing for details.Usage
From a new dataset (crawl a website and store the data in an Apify dataset)
If you don’t already have an existing dataset on the Apify platform, you’ll need to initialize the document loader by calling an Actor and waiting for the results. In the example below, we use the Website Content Crawler Actor to crawl LangChain documentation, store the results in Apify Dataset, and then load the dataset using theApifyDatasetLoader.
For this demonstration, we’ll use a fast Cheerio crawler type and limit the number of crawled pages to 10.
Note: Running the Website Content Crawler may take some time, depending on the size of the website. For large sites, it can take several hours or even days!
Here’s an example:
When to use Apify
Apify is ideal when you need:- Access to thousands of pre-built Actors for various platforms (social media, e-commerce, search engines, etc.)
- Custom web scraping and automation workflows beyond simple search
- Flexible Actor ecosystem – run any Actor from the Apify Store
From an existing dataset
If you’ve already run an Actor and have an existing dataset on the Apify platform, you can initialize the document loader directly using the constructorAdditional Actor examples
The Apify Store contains thousands of pre-built Actors. Here are examples of other popular Actors you can use with the document loader:Instagram Scraper
Google Search Results Scraper
Using Apify MCP server
Unsure which Actor to use or what parameters it requires? The Apify MCP (Model Context Protocol) server can help you discover available Actors, explore their input schemas, and understand parameter requirements. When connecting to the Apify MCP server over HTTP, include your Apify token in the request headers:Connect these docs to Claude, VSCode, and more via MCP for real-time answers.