Skip to main content
POST
提交一个异步的抓取任务。
url 为根抓取整个站点。由于完整遍历可能耗时较长,Crawl 以异步任务方式运行:先提交任务,然后轮询获取状态和结果。 生命周期
  1. 提交 —— POST /apis/v1/firecrawl/crawl,带上抓取请求体和必填的 Idempotency-Key 请求头。成功后返回 202 Accepted、指向任务资源的 Location 响应头(/apis/v1/firecrawl/crawl/{jobId}),以及一个 status 初始为 queued 的任务对象。
  2. 轮询 —— GET /apis/v1/firecrawl/crawl/{jobId},重复直到 status 进入终态:completedfailedcancelled。当为 completed 时,抓取到的页面位于 output 中。
  3. 列表 —— GET /apis/v1/firecrawl/crawl(可选 limitstatuscursor 查询参数)用于翻阅你的抓取任务。
  4. 取消 —— POST /apis/v1/firecrawl/crawl/{jobId}/cancel 请求取消。
url 必须是 HTTPS 且不能是 PDF,limit(1 到 1000)限制抓取页数。计费按 Firecrawl credit 计量——每抓取一页消耗 1 credit——因此总费用随实际处理的页数增长。如果要抓取一组已知 URL 而不是沿链接遍历,请使用 post_firecrawl-batch-scrape

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求头

Idempotency-Key
string
必填

使提交具备幂等性的唯一 key(1 到 191 字符)。使用相同 key 重复提交会返回原任务。

Maximum string length: 191

请求体

application/json
url
string<uri>
必填

要抓取的 HTTPS 根 URL。不支持 PDF URL。

示例:

"https://docs.firecrawl.dev"

limit
integer
必填

抓取页面数量的上限。

必填范围: 1 <= x <= 1000
示例:

50

includePaths
string[]

只抓取路径匹配这些模式之一的 URL。

Maximum array length: 20
Maximum string length: 256
excludePaths
string[]

跳过路径匹配这些模式之一的 URL。

Maximum array length: 20
Maximum string length: 256
maxDiscoveryDepth
integer

从根 URL 出发的链接发现最大深度。

必填范围: 0 <= x <= 10
sitemap
enum<string>

发现过程中如何使用站点的 sitemap。

可用选项:
skip,
include,
only
ignoreQueryParameters
boolean

把仅查询字符串不同的 URL 视为同一个页面。

crawlEntireDomain
boolean

抓取整个域名,而不仅限于根 URL 之下的子树。

沿链接进入外部域名。

allowSubdomains
boolean

沿链接进入根域名的子域名。

delay
number

两次请求之间的延迟秒数(0 到 30)。

必填范围: 0 <= x <= 30
maxConcurrency
integer

并发抓取页面数的上限(1 到 20)。

必填范围: 1 <= x <= 20
scrapeOptions
object

抓取过程中对每个页面应用的抓取选项。在计量模式下输出始终为 markdown。

响应

202 - application/json

抓取任务已受理。Location 响应头指向该任务资源;请轮询直到终态。

一个异步集成任务。由提交调用(HTTP 202)以及轮询/详情调用返回。请按 id 轮询该任务,直到 status 进入终态(completed、failed 或 cancelled)。

id
string

唯一的 AIsa 任务标识符。可用它轮询、列出或取消该任务。

示例:

"iaj_01HZY8Q2M4K7N9V3T6W1X0B2C3"

object
string

始终为 "integration_async_job"。

示例:

"integration_async_job"

endpoint
string

该任务所属的提交 endpoint。

示例:

"/apis/v1/firecrawl/crawl"

status
enum<string>

面向用户的生命周期状态。queued 和 running 为非终态;completed、failed 和 cancelled 为终态。

可用选项:
queued,
running,
completed,
failed,
cancelled
createdAt
string<date-time>

任务被受理的时间。

completedAt
string<date-time> | null

任务进入终态的时间。任务仍处于排队或运行中时为 null。

pricing
object
output
any | null

任务结果载荷。仅在 status 为 completed 后出现。对 crawl 而言是抓取到的页面数组;对 batch scrape 而言是抓取到的文档数组。

outputExpired
boolean

当结果已超过留存窗口、不再可获取时为 true。

error
object | null

当 status 为 failed 时出现,否则为 null。