> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Apify integrations

> Integrate with Apify using LangChain Python.

> [Apify](https://apify.com) is a cloud platform for web scraping and data extraction,
> which provides an [ecosystem](https://apify.com/store) of more than a thousand
> ready-made apps called *Actors* for various scraping, crawling, and extraction use cases.

## Overview

Apify provides access to thousands of prebuilt tools (Actors) for web scraping, data extraction, and automation.
The platform handles infrastructure management, allowing you to focus on data extraction logic.

## When to use Apify

* **Access to thousands of prebuilt 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

This integration enables you to run Actors on the `Apify` platform and load their results into LangChain to feed your vector
indexes with documents and data from the web, e.g., to generate answers from websites with documentation,
blogs, or knowledge bases.

## Installation and setup

* Install the LangChain Apify package for Python with:

<CodeGroup>
  ```bash pip theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  pip install langchain-apify
  ```

  ```bash uv theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  uv add langchain-apify
  ```
</CodeGroup>

* Get your [Apify API token](https://console.apify.com/account/integrations) and either set it as
  an environment variable (`APIFY_TOKEN`) or pass it as `apify_api_token` in the constructor.

## Tool

You can use the `ApifyActorsTool` to use Apify Actors with agents.

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_apify import ApifyActorsTool
```

See [this notebook](/oss/python/integrations/tools/apify_actors) for example usage and a full example of a tool-calling agent with LangGraph in the [Apify LangGraph agent Actor template](https://apify.com/templates/python-langgraph).

For more information on how to use this tool, visit [the Apify integration documentation](https://docs.apify.com/platform/integrations/langgraph).

## Wrapper

You can use the `ApifyWrapper` to run Actors on the Apify platform.

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_apify import ApifyWrapper
```

For more information on how to use this wrapper, see [the Apify integration documentation](https://docs.apify.com/platform/integrations/langchain).

## Use cases

* **Web scraping**: Extract data from websites, social media, e-commerce sites
* **Search engine results**: Scrape Google, Bing, and other search engines
* **Data collection**: Gather structured data for analysis and ML pipelines
* **Content aggregation**: Collect content from multiple sources for RAG applications

## Document loader

You can also use our `ApifyDatasetLoader` to get data from an Apify dataset.

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_apify import ApifyDatasetLoader
```

For a more detailed walkthrough of this loader, see [this notebook](/oss/python/integrations/document_loaders/apify_dataset).

## Pricing

Apify uses pay-per-use or pay-per-event pricing with a free tier available. Pricing varies by Actor:

* Some Actors are free (you only pay for platform compute units)
* Others charge for results or events
* **Pay-Per-Event (PPE) pricing**: Many Actors support [PPE pricing](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event), which is useful when you want predictable, usage-based costs in agent deployments
* See [Apify pricing](https://apify.com/pricing) for details

Source code for this integration can be found in the [LangChain Apify repository](https://github.com/apify/langchain-apify).

## MCP Server

Unsure which Actor to use or what parameters it requires?
Apify provides an [MCP (Model Context Protocol) server](https://mcp.apify.com) that helps 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:

```text theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
Authorization: Bearer <APIFY_TOKEN>
```

***

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

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