Skip to main content
Apify Actors are cloud programs designed for a wide range of web scraping, crawling, and data extraction tasks. These actors facilitate automated data gathering from the web, enabling users to extract, process, and store information efficiently. Actors can be used to perform tasks like scraping e-commerce sites for product details, monitoring price changes, or gathering search engine results. They integrate seamlessly with Apify Datasets, allowing the structured data collected by actors to be stored, managed, and exported in formats like JSON, CSV, or Excel for further analysis or use.

Overview

This notebook walks you through using Apify Actors with LangChain to automate web scraping and data extraction. The langchain-apify package integrates Apify’s cloud-based tools with LangChain agents, enabling efficient data collection and processing for AI applications.

Integration details

Tool features

Setup

This integration lives in the langchain-apify package. The package can be installed using pip.

Prerequisites

Pricing

Apify uses 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.

Instantiation

Here we instantiate the ApifyActorsTool to be able to call RAG Web Browser Apify Actor. This Actor provides web browsing functionality for AI and LLM applications, similar to the web browsing feature in ChatGPT. Any Actor from the Apify Store can be used in this way.

Invocation

The ApifyActorsTool takes a single argument, which is run_input - a dictionary that is passed as a run input to the Actor. Run input schema documentation can be found in the input section of the Actor details page. See RAG Web Browser input schema.

Chaining

We can provide the created tool to an agent. When asked to search for information, the agent will call the Apify Actor, which will search the web, and then retrieve the search results.

Additional Actor examples

The Apify Store contains thousands of prebuilt Actors. Here are examples of other popular Actors:

Instagram Scraper

Google Search Results Scraper

Browse the Apify Store to discover more Actors for your use case.

When to use Apify

Apify is ideal when you need:
  • 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
  • Infrastructure-free scraping (a serverless platform handles scaling and maintenance)
  • Flexible Actor ecosystem – run any Actor from the Apify Store

API reference

For more information on how to use this integration, see the git repository or the Apify integration documentation.

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 through the Model Context Protocol. To use the Apify MCP server with LangChain:
For more information, see the LangChain MCP documentation and Apify MCP server.