Firecrawl + LangChain
Add Firecrawl web search, scraping and crawling to LangChain agents and RAG apps.
The official langchain-firecrawl package ships agent tools and a document loader.
companies of all sizes
await firecrawl.scrape()
await firecrawl.scrape()
await firecrawl.scrape()
await firecrawl.scrape()
Key Features
How do I add web search to a LangChain agent?
To add web search to a LangChain agent, install langchain-firecrawl and pass its FirecrawlSearch tool to create_agent. The agent calls Firecrawl when a question needs current information, gets back titles, URLs and descriptions from the live web, and answers with those sources in context.
Install the packages
Install LangChain, the official Firecrawl package, and a chat model provider. Set FIRECRAWL_API_KEY from your Firecrawl dashboard and the key for your model provider.
pip install -U langchain langchain-firecrawl langchain-openai
export FIRECRAWL_API_KEY="fc-YOUR-API-KEY"
export OPENAI_API_KEY="sk-YOUR-API-KEY"Give the agent Firecrawl tools
FirecrawlSearch calls the Firecrawl search API and FirecrawlScrape reads a page as Markdown. With both, the agent can find pages and then read the best one in full.
from langchain.agents import create_agent
from langchain_firecrawl import FirecrawlScrape, FirecrawlSearch
agent = create_agent(
model="openai:gpt-6-luna",
tools=[FirecrawlSearch(), FirecrawlScrape()],
system_prompt=(
"Use firecrawl_search for anything current, then firecrawl_scrape "
"to read the best result. Cite the URLs you used."
),
)Ask a question that needs the web
The agent decides when to search. A question about a recent release triggers firecrawl_search, and the final message cites the pages it read.
result = agent.invoke(
{"messages": [{"role": "user", "content": "What's new in LangChain v1?"}]}
)
print(result["messages"][-1].content)Load search results as documents
For RAG, FirecrawlLoader in search mode turns the results of a web query into LangChain Document objects you can split and index. It also runs in scrape, crawl and map modes for known URLs.
from langchain_firecrawl import FirecrawlLoader
loader = FirecrawlLoader(query="LangChain agent middleware", mode="search", params={"limit": 5})
docs = loader.load()
print(len(docs), docs[0].metadata)People love
building with Firecrawl











Firecrawl is an open-source framework that takes a URL, crawls it, and conver..."

Upload a CSV of emails and..."



Firecrawl is an open-source framework that takes a URL, crawls it, and conver..."

Upload a CSV of emails and..."
Tutorials & guides
Build a 'Chat with website' using Groq Llama 3
Learn how to use Firecrawl, Groq Llama 3, and Langchain to build a 'Chat with your website' bot.
Read tutorial →Best Chunking Strategies for RAG in 2025
Compare six chunking strategies for RAG systems using real benchmark data with practical LangChain text splitter code examples.
Read tutorial →Frequently
asked questions
Flexible pricing
Free Plan
Hobby
StandardMost popular
Growth
Scale Plans
High-volume plans for teams that need more power and dedicated support. Get access to higher rate limits, more concurrent browsers, and priority support. Scale checks out instantly, no sales call needed.
Need more? Contact usAlso on AWS Marketplace and Google Cloud Marketplace.

















