Skip to main content
POST
提交一个异步的抓取任务。
url 出发爬整个站点,返回它保留的每个页面的内容。urllimitIdempotency-Key 必填;可用 includePathsexcludePathsmaxDiscoveryDepthcrawlEntireDomainallowSubdomainsdelaymaxConcurrency 引导。异步。提交后返回 HTTP 202 和一个任务信封 —— idobjectendpointstatuscreatedAtcompletedAtpricingoutputerror,此时 output 还是 null。轮询 get_firecrawl_crawl_job 直到 status 变成 completedfailedcancelled;届时 output 是一个页面数组,每项含 markdownmetadata。实测爬 3 个页面返回 43 KB、不到一分钟完成,而 pricing.billingModemetered_result,也就是成本随它找到多少而增长 —— 务必设 limit。每次不同的爬取都要换一个新的 Idempotency-Key;重复使用会返回之前那个任务而不是新建。只有几个已知 URL 时 post_firecrawl_batch_scrape 更便宜,只要结构不要内容时 post_firecrawl_map 便宜得多。

授权

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。