跳转到主要内容
POST
/
agent
启动用于 Agent 驱动数据提取的任务
curl --request POST \
  --url https://api.firecrawl.dev/v2/agent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "urls": [
    "<string>"
  ],
  "schema": {},
  "maxCredits": 123,
  "strictConstrainToURLs": true
}
'
{
  "success": true,
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

授权

Authorization
string
header
必填

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

请求体

application/json
prompt
string
必填

用于描述应提取哪些数据的提示词

Maximum string length: 10000
urls
string<uri>[]

用于限定智能体访问范围的可选 URL 列表

schema
object

用于定义提取数据结构的可选 JSON Schema

maxCredits
number

此代理任务可使用的最大积分额度

strictConstrainToURLs
boolean

如果为 true,代理将仅访问 urls 数组中提供的 URL

响应

代理任务已成功启动

success
boolean
id
string<uuid>