Firecrawl 指南:如何向其提供实时网络数据 AI 经纪人

Feed Real-Time Data into AI 拥有火行能力的特工

您的 AI agent has a problem. It knows everything about the world, up to the day its training ended. Ask it about a competitor's pricing page, a fresh news story, or the docs of a library that shipped last week, and it either guesses or apologizes.

The fix is real-time web data. And in 2026, the fastest way to pipe it into any AI system is Firecrawl.

We use Firecrawl across our own network. It powers scraping in our production apps, feeds our research agents, and runs inside our WordPress workflows. 

This tutorial is everything we wish someone had handed us on day one: the no-code one-click setup, the Python and Node code, structured extraction, a working RAG pipeline, and the cost tricks that keep the bill tiny.

Zero fluff. Let's 建造。🚀

What We'll Build in This Firecrawl Guide

By the end of this tutorial you will know how to:

  1. Connect Firecrawl to Claude, ChatGPT, or Cursor in one click (no code at all)
  2. Scrape any URL into clean, LLM-ready markdown with Python or Node
  3. Crawl an entire website into a dataset
  4. Extract structured JSON from messy pages using a schema
  5. Wire live web data into a RAG pipeline with LangChain or LlamaIndex
  6. Keep your credit usage lean

The only prerequisite is a Firecrawl API key. That part is free.

Step 1: Get Your API Key (1,000 Free Credits, No Card) 🔑

火爬's 免费计划为您提供 1,000 credits every month. One credit equals one scraped page, so that is 1,000 pages monthly, renewing forever, with no credit card required. It is more than enough to complete this entire tutorial many times over.

Mojo Pick 火爬 给你 1,000 free monthly credits through this link, plus an 自动 10% 折扣 on your first upgrade. Annual billing also gives you roughly 2免费. 激活优惠 →
查看价格 →

Once you are in the dashboard, copy your API key. It starts with fc-. That string is your ticket to everything below.

Step 2: The One-Click Route (No Code Required) ⚡

Before we write a single line of code, know this: you might not need any.

Firecrawl runs an official MCP (Model Context Protocol) server, and it connects to your favorite AI tools the same way you would connect a Gmail account. The hosted server lives at:

https://mcp.firecrawl.dev/v2/mcp

Add your API key into the URL and any MCP-compatible tool can use it:

https://mcp.firecrawl.dev/fc-YOUR_API_KEY/v2/mcp

In Claude (web or desktop): add Firecrawl as a connector, or drop this into claude_desktop_config.json:

{
  "mcpServers": {
    "firecrawl": {
      "command": "npx",
      "args": ["-y", "firecrawl-mcp"],
      "env": {
        "FIRECRAWL_API_KEY": "fc-YOUR_API_KEY"
      }
    }
  }
}
In Cursor: Settings → Features → MCP Servers → Add new global MCP server, paste the same JSON.
In ChatGPT and Perplexity: add Firecrawl as a connector using the hosted MCP URL above. Same idea, different settings menu.
In VS Code: there is literally a one-click install badge on the official MCP repo.

一旦连接,您的 AI 助理 gets ten new abilities: scrape, search, crawl, map, extract, interact, monitor, parse, research, and a full autonomous agent. And you drive all of it in plain English.

Try prompts like these:

  1. Scrape https://competitor.com/pricing and summarize every plan in a table.
  2. Crawl the docs at docs.example.com, max 50 pages, and explain how their auth works.
  3. Search the web for “best AI video generators 2026” and compare the top 5 results.

This is the setup our non-technical team members use daily. No terminal, no code, real live web data inside every conversation. If that is all you needed, you can honestly stop here. But if you are building apps, the API is where Firecrawl gets fun.

Step 3: Scrape Your First Page with the API 🐍

Time for code. Install the SDK:

# Python
pip install firecrawl
# Node.js
npm install firecrawl

Scraping a URL takes three lines. Here is Python:

from firecrawl import Firecrawl

firecrawl = Firecrawl(api_key="fc-YOUR_API_KEY")
doc = firecrawl.scrape("https://firecrawl.dev", formats=["markdown"])
print(doc.markdown)

And Node:

import { Firecrawl } from 'firecrawl';
const firecrawl = new Firecrawl({ apiKey: 'fc-YOUR_API_KEY' });
const doc = await firecrawl.scrape('https://firecrawl.dev', { formats: ['markdown'] });
console.log(doc.markdown);

Run it and look at the output. That is the entire trick that makes Firecrawl special: what comes back is not raw HTML soup. It is clean markdown with proper headings, lists, and links, with the nav bars, cookie banners, scripts, and footer junk already stripped out.

Why does that matter so much? Two reasons. Tokens and accuracy. Raw HTML from a typical page can be 10x the size of its actual content, and every junk token costs money and dilutes your model's attention. Clean markdown means smaller prompts, lower LLM bills, and answers grounded in content instead of clutter.

You can also request other formats in the same call: html, screenshot, links, or structured json. Stack them as needed:

doc = firecrawl.scrape(
    "https://example.com/blog/post",
    formats=["markdown", "links"]
)

火爬 renders JavaScript by default, so React sites, dynamic pages, and client-rendered content come back complete. No headless browser babysitting on your side.

Step 4: Crawl a Whole Website 🕸️

One page is a demo. A whole site is a dataset.

The crawl endpoint follows links from a starting URL and scrapes everything it finds, with controls for depth, page limits, and path filters:

from firecrawl import Firecrawl
from firecrawl.types import ScrapeOptions
firecrawl = Firecrawl(api_key="fc-YOUR_API_KEY")
crawl_status = firecrawl.crawl(
    'https://docs.example.com',
    limit=100,
    scrape_options=ScrapeOptions(formats=['markdown']),
    poll_interval=30
)
for page in crawl_status.data:
    print(page.metadata.url)

Node version:

const crawlResponse = await firecrawl.crawl('https://docs.example.com', {
  limit: 100,
  scrapeOptions: { formats: ['markdown'] }
});
console.log(`Crawled ${crawlResponse.data.length} pages`);

The SDK handles job polling and pagination for you and returns every page as clean markdown. Three parameters worth memorizing:

  • 限制 caps total pages. Always set it. This is your credit seatbelt.
  • includePaths / excludePaths filter URLs with regex patterns. Crawling a docs site? Exclude /blog/.* and /careers/.* and stop paying for pages you will never use.
  • maxDiscoveryDepth controls how many link-hops from the start URL the crawler follows.

专业举动: before any big crawl, hit the 地图 endpoint first. It returns every URL on a site in a couple of seconds for almost no credits. Scope the job, count the pages, then crawl exactly what you need.

result = firecrawl.map("https://docs.example.com")
print(f"{len(result.links)} URLs found")

Step 5: Extract Structured Data with a Schema 📊

Markdown is perfect for RAG. But sometimes you need fields, not prose: product names, prices, ratings. That is the Extract endpoint's job. You describe the shape of the data, Firecrawl's AI pulls it out of the page:

schema = {
    "type": "object",
    "properties": {
        "product_name": {"type": "string"},
        "price": {"type": "string"},
        "rating": {"type": "number"},
        "in_stock": {"type": "boolean"}
    },
    "required": ["product_name", "price"]
}
result = firecrawl.extract(
    urls=["https://example-store.com/product/xyz"],
    prompt="Extract the product details from this page",
    schema=schema
)
print(result.data)

No CSS selectors. No XPath. No parser that shatters the moment the site changes its layout. You define what you want, and the extraction survives redesigns because it understands content, not markup.

This exact pattern runs in production on our network: one of our apps uses Extract to turn messy provider pages into a uniform pricing database, automatically, on a schedule. The same schema works across dozens of differently-designed sites. Try building that with regex and report back. 😅

Scraping handles URLs you already know. Search handles the ones you do not.

火爬's Search endpoint is the sleeper feature of the whole platform. Most search APIs return links and a snippet, then leave you to fetch and clean every result yourself. Firecrawl returns the results with the full scraped content included, in one call:

results = firecrawl.search(
    query="best open source LLMs 2026",
    limit=5
)

for item in results.web:

    print(item.title, item.url)

Node, with content scraping enabled per result:

const results = await firecrawl.search('best open source LLMs 2026', {
  limit: 5,
  scrapeOptions: { formats: ['markdown'] }
});

This is the building block for 研究代理. The loop is simple: your agent forms a query, Firecrawl returns readable content from the top results, your LLM synthesizes an answer with sources. That is deep research, and you just built it in a dozen lines.

成本说明: Search runs 2 credits per 10 results, plus normal scrape credits when you pull full content. Still dramatically cheaper than any dedicated answer API we have tested.

Step 7: Wire It into a RAG Pipeline 🧠

Now the main event: feeding an AI agent live web knowledge. Both major frameworks ship first-class Firecrawl loaders.

浪链:

  1. from langchain_community.document_loaders import FireCrawlLoader
  2. from langchain_text_splitters import RecursiveCharacterTextSplitter
  3. from langchain_openai import OpenAIEmbeddings
  4. from langchain_community.vectorstores import FAISS

# 1. Load a whole site as clean documents

loader = FireCrawlLoader(
    api_key="fc-YOUR_API_KEY",
    url="https://docs.example.com",
    mode="crawl"
)
docs = loader.load()

# 2. Chunk them

splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
chunks = splitter.split_documents(docs)

# 3. Embed and index

vectorstore = FAISS.from_documents(chunks, OpenAIEmbeddings())

# 4. Ask questions against live web data

retriever = vectorstore.as_retriever()
relevant = retriever.invoke("How do I authenticate API requests?")

骆驼指数:

  • from llama_index.readers.web import FireCrawlWebReader
  • from llama_index.core import VectorStoreIndex
reader = FireCrawlWebReader(
    api_key="fc-YOUR_API_KEY",
    mode="crawl",
    url="https://docs.example.com"
)
documents = reader.load_data()
index = VectorStoreIndex.from_documents(documents)
response = index.as_query_engine().query("How does their pricing work?")
print(response)

That is a complete “chat with any website” pipeline in under 25 lines. Because Firecrawl hands the loader clean markdown instead of HTML, your chunks are coherent, your embeddings are meaningful, and your retrieval quality jumps compared to naive scraping. This is the single biggest reason RAG builders pick Firecrawl.

The same loaders work with CrewAI, Dify, Flowise, and n8n if visual workflows are more your speed.

Bonus: The Cost-Saving Architecture Nobody Talks About 💡

Here is the pattern that saves our apps real money every month.

When your app needs web-aware answers, the obvious route is an LLM with built-in web search. But providers bill web search as a premium add-on, and dedicated answer APIs get expensive fast at scale.

The smarter split:

Firecrawl (fetch, ~$0.001/page) → cheap LLM (reason, no web access needed)

Firecrawl searches and scrapes for a credit or two per request. Then any inexpensive model, DeepSeek, a small GPT or Claude tier, or whatever open model you run on your own VPS, does the summarizing and writing over that clean content. Same quality of answer. A fraction of the cost.

This also works beautifully for self-hosted setups. Running Open WebUI or another open source chat UI on a VPS? Connect Firecrawl as its web search and crawling layer, and your self-hosted AI suddenly does live deep research like the big commercial products.

Cost Tips: Make 1,000 Free Credits Go Far 🪙

Quick reference for keeping usage lean:

操作信贷成本
Scrape / Crawl / Map / Monitor1 credit per page
搜索2 credits per 10 results
Interact (browser actions)每分钟 2 积分
Stealth mode (protected sites)5 credits per page

Five habits that matter:

  1. Map before you crawl. Know the page count before you pay it.
  2. 始终设置 限制 on crawls. Default is 10,000 pages. Your free tier is 1,000. Do the math once, not after.
  3. 绝大部分储备使用 excludePaths aggressively. Blog archives, tag pages, and career pages are credit landfills.
  4. Cache what you scrape. Docs sites change weekly, not hourly. Store results and re-crawl on a schedule instead of per-request.
  5. 学分不会累积。, so if you upgrade, size the plan to your real monthly volume. Paid plans start at $16/month for 5,000 credits, and the $83 Standard tier gives you 100,000 pages.

Five issues that account for basically every “Firecrawl isn't working” message we get:

Crawl ate way more credits than expected. You forgot limit, or you crawled a site with pagination archives.
修复: Map first, set limit, exclude /tag/, /page/, and /category/ paths.
A protected site keeps failing. Some targets sit behind aggressive anti-bot walls.
修复: enable stealth mode (proxy option in scrape settings), and budget 5 credits per page for those specific targets. If the whole project is fortress sites, Firecrawl may not be the right weapon; that is a dedicated unblocker's 工作。
Content is missing from a dynamic page. The data probably loads after a user action.
修复: use the Actions/Interact capability to click or scroll before scraping, or add a wait before capture.
Output includes junk you did not want. Use the onlyMainContent option (on by default) and pick your formats deliberately. Requesting only markdown keeps responses tight.
修复: queue your scrapes sequentially, or upgrade for higher concurrency (paid tiers go from 5 up to 150 concurrent requests).
Rate limit errors on the free plan. Free tier allows 2 concurrent requests.

And one non-mistake worth knowing: if a request fails on Firecrawl's side, you are not charged for it.

快速解答🎯

How does Firecrawl work?

You send a URL (or search query) to its API, and it returns the content as clean markdown, JSON, or screenshots, with JavaScript rendering and junk removal handled automatically. One credit per page.

Is Firecrawl good for RAG?

It is the default choice in 2026. Clean markdown output means better chunks, better embeddings, and better retrieval, with official loaders for LangChain and LlamaIndex.

Can I use Firecrawl without coding?

Yes. The one-click MCP connector puts scrape, crawl, search, and extract inside Claude, ChatGPT, Perplexity, and Cursor, driven by plain English prompts.

是否有免费版本?

1,000 credits every month, renewing, no card required. Grab it here with 10% off your first upgrade.

Wrapping Up: Your Agent, Now With Eyes 👀

Recap of what you just learned:

One-click MCP puts live web data inside Claude, ChatGPT, and Cursor with zero code
刮() turns any URL into clean, LLM-ready markdown in 3 lines
crawl() turns whole websites into datasets, with limit and path filters guarding your credits
提炼() pulls structured JSON with a schema instead of fragile selectors
LangChain and LlamaIndex loaders make “chat with any website” a 25-line project
Firecrawl + a cheap LLM beats expensive search-enabled APIs on cost, every time

The gap between an AI agent that guesses and an AI agent that knows is one API key. Firecrawl gives you 1,000 free credits a month to close it, and every example in this guide runs comfortably inside that allowance.

Mojo Pick
Start building today with Firecrawl
Sign up through this link to claim 1,000 free monthly credits,加上一个 automatic 10% off your first purchase2 months free on annual plans if you scale later.
1,000
免费学分
10%
首次购买
~2 MB
Free Annual
Free monthly credits first · Automatic discount at checkout · Better value on annual

Got a build powered by Firecrawl?
Tell us in the comments. The best reader projects end up featured in our newsletter. ✌️

发表评论

您的电邮地址不会被公开。 必填项 *

本网站使用Akismet来减少垃圾邮件。 了解您的评论数据是如何被处理的。

即刻加入 Aimojo 部落!

每周加入 76,200 多名会员获取内幕消息! 
🎁 奖金: 获得我们的 200 美元“AI 注册即可免费获得“精通工具包”!

热门 AI 工具
Sayscroll

此 AI 语音提示器,让您从此告别追着稿子跑的烦恼 为创作者、演讲者和专业人士提供 60 多种语言的语音控制提示。

克洛什

在不中断质量保证周期的情况下,更快地发布移动应用 专为真实设备覆盖率而构建的 AI 驱动型移动测试

雷米奥 

将你阅读、观看和录制的所有内容整合到一个可搜索的平台中。 AI 脑。 专为研究人员、顾问和内容团队打造的私有“第二大脑”。

链接导航

在LinkedIn上找到真正的购买信号,并将它们转化为已安排的会议。 LinkedIn AI 专为注重客户意图而非数量的外呼团队打造的销售开发代表 (SDR)。

谷歌双子座

将您的 Google Workspace 变成一个 AI 动力指挥中心 权威 AI 用于搜索、基于研究和多模态创作的聊天机器人

© 2023 - 2026 版权所有 | 成为 AI 专业版 | 用心打造