2 Months Free - Annually

Firecrawl + LangGraph

Add Firecrawl web search and scraping to LangGraph agents.
Give stateful AI agents live web results through a tool they call when a question needs it.

//
Used by over 1.25M developers
//
Trusted by 150,000+
companies
of all sizes
[ 01 / 04 ]
·
Features

Key Features

Stateful agent workflows
Cyclic graph execution
Human-in-the-loop support
Built-in persistence
Complex reasoning chains
Web search and scraping as LangGraph tools
[ 02 / 04 ]
·
Installation

How do I add web search to a LangGraph agent?

To add web search to a LangGraph agent, give the model the Firecrawl search tool from the langchain-firecrawl package and route its tool calls through a ToolNode. The agent decides when to search, Firecrawl returns titles, URLs and descriptions from the live web, and the graph loops until the model has an answer.

1

Install the packages

Install LangGraph, the official Firecrawl package for LangChain, and a chat model provider. Set FIRECRAWL_API_KEY from your Firecrawl dashboard and the key for your model provider.

Terminal
pip install -U langgraph langchain-firecrawl langchain-openai
export FIRECRAWL_API_KEY="fc-YOUR-API-KEY"
export OPENAI_API_KEY="sk-YOUR-API-KEY"
2

Create the Firecrawl search tool

FirecrawlSearch is a LangChain tool that calls the Firecrawl search API, so LangGraph can bind it to any chat model that supports tool calling. The model passes a query and an optional result limit.

agent.py
from langchain_firecrawl import FirecrawlSearch

search = FirecrawlSearch()
tools = [search]

print(search.invoke({"query": "LangGraph latest release", "limit": 3}))
3

Build the graph

The agent node calls the model. tools_condition sends any tool call to the ToolNode, which runs the Firecrawl search and hands the results back to the model.

agent.py
from langchain_openai import ChatOpenAI
from langgraph.graph import StateGraph, MessagesState, START
from langgraph.prebuilt import ToolNode, tools_condition

llm = ChatOpenAI(model="gpt-6-luna").bind_tools(tools)

def agent(state: MessagesState):
    return {"messages": [llm.invoke(state["messages"])]}

graph = StateGraph(MessagesState)
graph.add_node("agent", agent)
graph.add_node("tools", ToolNode(tools))
graph.add_edge(START, "agent")
graph.add_conditional_edges("agent", tools_condition)
graph.add_edge("tools", "agent")
app = graph.compile()
4

Ask a question that needs the web

The search tool runs only when the model asks for it. Questions about recent releases, prices or news trigger a Firecrawl search, and the model can cite the URLs it got back.

agent.py
result = app.invoke(
    {"messages": [{"role": "user", "content": "What changed in the latest LangGraph release? Cite your sources."}]}
)
print(result["messages"][-1].content)
[ 03 / 04 ]
·
What Our Customers Say
//
Community
//

People love
building with Firecrawl

Discover why developers choose Firecrawl every day.
//
FAQ
//

Frequently
asked questions

Everything you need to know about this integration.
General
LangGraph doesn't ship its own search engine. Web search comes from a tool you add to the graph, such as Firecrawl's FirecrawlSearch from the langchain-firecrawl package, which works in a custom StateGraph or a prebuilt agent.
FirecrawlSearch returns a list of results with the URL, title and description of each page. The model can also pass sources such as web or news, result categories, and a time filter such as the past day.
Technical
Yes. Add FirecrawlScrape from the same package as a second tool. The agent searches first, then scrapes the most relevant URLs into clean Markdown before it answers.
A Firecrawl search costs 2 credits per 10 results, rounded up, and scraping a page costs 1 credit. The Free plan includes 1,000 credits a month, enough for 500 searches of up to 10 results each.
Integration
Yes. langchain-firecrawl is a Python package, so in LangGraph.js you wrap the search method of the Firecrawl Node SDK in a LangChain tool and pass it to a ToolNode the same way.
Why Firecrawl?
The world's most comprehensive web data API. Our custom browser stack and semantic index deliver superior data quality across any website, handling more content types and edge cases than any competitor.
JavaScript rendering, dynamic content, and robust request handling built-in.
Process millions of pages with automatic rate limiting, caching, and distributed infrastructure.
Optimized scraping engine with parallel processing and smart caching for instant results.
Comprehensive docs, SDKs for all major languages, and dedicated support to help you succeed.
[ 04 / 04 ]
·
Pricing

Flexible pricing

Start for free, then scale as you grow.Are you an AI agent? See pricing

Free Plan

A lightweight way to get started.
No cost, no card, no hassle.
$0
/month
500 searches or 1,000 pages scraped
2 concurrent requests
Low rate limits

Hobby

Great for side projects and small tools.
Fast, simple, no overkill.
$16
/month
Billed yearly
Save $38
2,500 searches or 5,000 pages scraped
5 concurrent requests
Basic support
$9 per extra 1.5k credits

Standard
Most popular

Perfect for scaling with less effort.
Simple, solid, dependable.
$83
/month
Billed yearly
Save $198
50,000 searches or 100,000 pages scraped
25 concurrent requests
Standard support
$47 per extra 35k credits

Growth

Built for high volume and speed.
Firecrawl at full force.
$333
/month
Billed yearly
Save $798
250,000 searches or 500,000 pages scraped
50 concurrent requests
Priority support
$177 per extra 175k credits

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 us

Also on AWS Marketplace and Google Cloud Marketplace.

Scale

For teams scaling their data pipelines
1,000,000 credits / month
$599/month
Billed yearly
Save $1,798
500,000 searches or 1,000,000 pages scraped
100 concurrent requests
Priority support
$397 per extra 350k credits

Enterprise

Power at your pace with custom solutions
Custom credits
Custom concurrent requests
Dedicated support & SLA
Bulk discounts
Zero-data retention
SSO & advanced security
//
Get started
//
Ready to build agents?
Start creating autonomous AI workflows today.
Are you an AI agent? See setup options