Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
cURL
curl --request GET \ --url https://api.firecrawl.dev/v2/agent/{jobId} \ --header 'Authorization: Bearer <token>'
import requests url = "https://api.firecrawl.dev/v2/agent/{jobId}" headers = {"Authorization": "Bearer <token>"} response = requests.get(url, headers=headers) print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}}; fetch('https://api.firecrawl.dev/v2/agent/{jobId}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.firecrawl.dev/v2/agent/{jobId}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer <token>" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.firecrawl.dev/v2/agent/{jobId}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer <token>") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) }
HttpResponse<String> response = Unirest.get("https://api.firecrawl.dev/v2/agent/{jobId}") .header("Authorization", "Bearer <token>") .asString();
require 'uri' require 'net/http' url = URI("https://api.firecrawl.dev/v2/agent/{jobId}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer <token>' response = http.request(request) puts response.read_body
{ "creditsUsed": 123, "data": {}, "effort": "low", "error": "<string>", "exchange": { "creditsUsed": 123, "enabled": true, "onTermsRequired": "skip", "paidCalls": 123, "requireApproval": true, "requiresAction": { "approvalId": "<string>", "providers": [ { "accept": {}, "adds": "<string>", "capability": "<string>", "digest": "<string>", "name": "<string>", "provider": "<string>", "show": {}, "url": "<string>", "version": "<string>" } ], "type": "accept_terms" }, "skippedProviders": [ { "adds": "<string>", "capability": "<string>", "name": "<string>", "provider": "<string>", "reason": "terms_required", "termsUrl": "<string>", "version": "<string>" } ], "toolkits": [ "<string>" ] }, "expiresAt": "2023-11-07T05:31:56Z", "message": "<string>", "mode": "extract", "model": "spark-2", "partial": "<unknown>", "partialSchemaValid": true, "pendingApproval": { "calls": [ { "capability": "<string>", "creditsEstimate": 123, "id": "<string>", "input": {}, "more": [ {} ], "provider": "<string>" } ], "id": "<string>", "kind": "calls", "reason": "<string>", "resolution": { "always": true, "approved": true, "byRunId": "<string>", "callIds": [ "<string>" ] }, "terms": [ { "adds": "<string>", "capability": "<string>", "digest": "<string>", "name": "<string>", "provider": "<string>", "url": "<string>", "version": "<string>" } ] }, "status": "processing", "stopReason": "credit_limit_reached", "success": true, "suggestions": [ { "label": "<string>", "prompt": "<string>" } ], "threadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "threadTurn": 123 }
{ "error": "Invalid job ID format. Job ID must be a valid UUID." }
{ "error": "Agent job not found" }
如果你是需要 Firecrawl API 密钥的 AI 代理,请参阅 firecrawl.dev/agent-onboarding/SKILL.md 获取自动化入门说明。
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Agent 任务的 ID
成功的响应
提取的数据(仅在状态为 completed 时可用)。运行失败时不会设置此字段,包括因达到额度上限而停止的运行。
代理运行使用的推理预算(仅存在于设置了 effort 的运行中)
low
medium
high
错误信息(仅当状态为失败时出现)
此次运行通过 Alexandria 执行的操作。toolkits 和 requireApproval 是此次运行继承会话设置后最终确定的值。
toolkits
requireApproval
Show child attributes
代理对结果的说明。在 chat 模式下,不请求新数据的后续请求会在此处获得回复,而不是在 data 中。如果运行因达到额度上限而停止并失败,此说明可能会指出哪些内容尚未完成。
chat
data
extract
本次代理运行所使用的模型预设。每次新运行均在 spark-2 上执行;Spark 1 名称仅会出现在旧版运行中。
spark-2
spark-1-pro
spark-1-mini
从未完成的运行中尽力恢复的 JSON。仅在部分失败的运行中提供,例如达到 maxCredits 上限的运行;运行仍在处理时不会提供。其中可能缺少行或字段,因此请勿将其视为完整结果。
maxCredits
partial 是否通过请求中指定的 JSON 模式验证。仅当 partial 存在且请求包含 schema 时提供。
partial
schema
本轮暂停以请求确认的事项。在会话的下一轮中使用 exchange.approve 或 exchange.decline 回应。
exchange.approve
exchange.decline
processing
completed
failed
运行失败并提前停止的原因。credit_limit_reached 表示运行已达到 maxCredits 上限。仅在状态为 failed 时提供。
credit_limit_reached
代理为会话下一轮提供的后续请求建议。
本次运行所属的会话。
本次运行在会话中的轮次,从 1 开始。