获取爬取任务状态
curl --request GET \
--url https://api.firecrawl.dev/v2/crawl/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firecrawl.dev/v2/crawl/{id}"
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/crawl/{id}', 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/crawl/{id}",
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/crawl/{id}"
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/crawl/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/crawl/{id}")
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{
"completed": 123,
"completedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"creditsUsed": 123,
"data": [
{
"html": "<string>",
"links": [
"<string>"
],
"markdown": "<string>",
"metadata": {
"<any other metadata> ": "<string>",
"concurrencyLimited": true,
"concurrencyQueueDurationMs": 123,
"description": "<string>",
"error": "<string>",
"keywords": "<string>",
"language": "<string>",
"numPages": 123,
"ogLocaleAlternate": [
"<string>"
],
"sourceURL": "<string>",
"statusCode": 123,
"title": "<string>",
"totalPages": 123,
"url": "<string>"
},
"rawHtml": "<string>",
"screenshot": "<string>"
}
],
"duration": 123,
"expiresAt": "2023-11-07T05:31:56Z",
"next": "<string>",
"status": "<string>",
"total": 123
}{
"error": "Payment required to access this resource."
}{
"error": "Request rate limit exceeded. Please wait and try again later."
}{
"error": "An unexpected error occurred on the server."
}爬取端点
获取抓取状态
GET
/
crawl
/
{id}
获取爬取任务状态
curl --request GET \
--url https://api.firecrawl.dev/v2/crawl/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firecrawl.dev/v2/crawl/{id}"
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/crawl/{id}', 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/crawl/{id}",
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/crawl/{id}"
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/crawl/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/crawl/{id}")
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{
"completed": 123,
"completedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"creditsUsed": 123,
"data": [
{
"html": "<string>",
"links": [
"<string>"
],
"markdown": "<string>",
"metadata": {
"<any other metadata> ": "<string>",
"concurrencyLimited": true,
"concurrencyQueueDurationMs": 123,
"description": "<string>",
"error": "<string>",
"keywords": "<string>",
"language": "<string>",
"numPages": 123,
"ogLocaleAlternate": [
"<string>"
],
"sourceURL": "<string>",
"statusCode": 123,
"title": "<string>",
"totalPages": 123,
"url": "<string>"
},
"rawHtml": "<string>",
"screenshot": "<string>"
}
],
"duration": 123,
"expiresAt": "2023-11-07T05:31:56Z",
"next": "<string>",
"status": "<string>",
"total": 123
}{
"error": "Payment required to access this resource."
}{
"error": "Request rate limit exceeded. Please wait and try again later."
}{
"error": "An unexpected error occurred on the server."
}如果你是需要 Firecrawl API 密钥的 AI 代理,请参阅 firecrawl.dev/agent-onboarding/SKILL.md 了解自动化入门说明。
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
路径参数
爬取任务的 ID
响应
成功的响应
已成功爬取的页面数量。
爬取完成的日期和时间。仅当爬取处于终态(completed、failed 或 cancelled)时才会显示。
爬取开始的日期和时间。
本次爬取所使用的积分数量。
本次爬取的数据。
Show child attributes
Show child attributes
爬取持续时间,单位为秒。对于已结束的爬取,这是从 createdAt 到 completedAt 的耗时。对于进行中的爬取,这是从 createdAt 到当前的耗时。
此抓取任务的到期日期和时间。
用于获取后续 10MB 数据的 URL。当抓取尚未完成,或响应内容超过 10MB 时,会返回该字段。
当前爬取任务的状态。状态可能为 scraping、completed 或 failed。
尝试爬取的页面总数。
⌘I

