curl --request POST \
--url https://api.firecrawl.dev/v2/crawl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"allowExternalLinks": false,
"allowSubdomains": false,
"crawlEntireDomain": false,
"delay": 123,
"excludePaths": [
"<string>"
],
"ignoreQueryParameters": false,
"ignoreRobotsTxt": false,
"includePaths": [
"<string>"
],
"limit": 10000,
"maxConcurrency": 123,
"maxDiscoveryDepth": 123,
"prompt": "<string>",
"regexOnFullURL": false,
"robotsUserAgent": "<string>",
"scrapeOptions": {
"actions": [
{
"milliseconds": 2,
"type": "wait"
}
],
"blockAds": true,
"excludeTags": [
"<string>"
],
"formats": [
"markdown"
],
"headers": {},
"includeTags": [
"<string>"
],
"location": {
"country": "US",
"languages": [
"en-US"
]
},
"lockdown": false,
"maxAge": 172800000,
"minAge": 123,
"mobile": false,
"onlyCleanContent": false,
"onlyMainContent": true,
"parsers": [
"pdf"
],
"proxy": "auto",
"redactPII": false,
"removeBase64Images": true,
"skipTlsVerification": true,
"storeInCache": true,
"threatProtection": {
"blacklist": [
"<string>"
],
"blockedTlds": [
"<string>"
],
"riskScoreThreshold": 75,
"whitelist": [
"<string>"
]
},
"timeout": 60000,
"waitFor": 0
},
"sitemap": "include",
"zeroDataRetention": false
}
'import requests
url = "https://api.firecrawl.dev/v2/crawl"
payload = {
"url": "<string>",
"allowExternalLinks": False,
"allowSubdomains": False,
"crawlEntireDomain": False,
"delay": 123,
"excludePaths": ["<string>"],
"ignoreQueryParameters": False,
"ignoreRobotsTxt": False,
"includePaths": ["<string>"],
"limit": 10000,
"maxConcurrency": 123,
"maxDiscoveryDepth": 123,
"prompt": "<string>",
"regexOnFullURL": False,
"robotsUserAgent": "<string>",
"scrapeOptions": {
"actions": [
{
"milliseconds": 2,
"type": "wait"
}
],
"blockAds": True,
"excludeTags": ["<string>"],
"formats": ["markdown"],
"headers": {},
"includeTags": ["<string>"],
"location": {
"country": "US",
"languages": ["en-US"]
},
"lockdown": False,
"maxAge": 172800000,
"minAge": 123,
"mobile": False,
"onlyCleanContent": False,
"onlyMainContent": True,
"parsers": ["pdf"],
"proxy": "auto",
"redactPII": False,
"removeBase64Images": True,
"skipTlsVerification": True,
"storeInCache": True,
"threatProtection": {
"blacklist": ["<string>"],
"blockedTlds": ["<string>"],
"riskScoreThreshold": 75,
"whitelist": ["<string>"]
},
"timeout": 60000,
"waitFor": 0
},
"sitemap": "include",
"zeroDataRetention": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
allowExternalLinks: false,
allowSubdomains: false,
crawlEntireDomain: false,
delay: 123,
excludePaths: ['<string>'],
ignoreQueryParameters: false,
ignoreRobotsTxt: false,
includePaths: ['<string>'],
limit: 10000,
maxConcurrency: 123,
maxDiscoveryDepth: 123,
prompt: '<string>',
regexOnFullURL: false,
robotsUserAgent: '<string>',
scrapeOptions: {
actions: [{milliseconds: 2, type: 'wait'}],
blockAds: true,
excludeTags: ['<string>'],
formats: ['markdown'],
headers: {},
includeTags: ['<string>'],
location: {country: 'US', languages: ['en-US']},
lockdown: false,
maxAge: 172800000,
minAge: 123,
mobile: false,
onlyCleanContent: false,
onlyMainContent: true,
parsers: ['pdf'],
proxy: 'auto',
redactPII: false,
removeBase64Images: true,
skipTlsVerification: true,
storeInCache: true,
threatProtection: {
blacklist: ['<string>'],
blockedTlds: ['<string>'],
riskScoreThreshold: 75,
whitelist: ['<string>']
},
timeout: 60000,
waitFor: 0
},
sitemap: 'include',
zeroDataRetention: false
})
};
fetch('https://api.firecrawl.dev/v2/crawl', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'allowExternalLinks' => false,
'allowSubdomains' => false,
'crawlEntireDomain' => false,
'delay' => 123,
'excludePaths' => [
'<string>'
],
'ignoreQueryParameters' => false,
'ignoreRobotsTxt' => false,
'includePaths' => [
'<string>'
],
'limit' => 10000,
'maxConcurrency' => 123,
'maxDiscoveryDepth' => 123,
'prompt' => '<string>',
'regexOnFullURL' => false,
'robotsUserAgent' => '<string>',
'scrapeOptions' => [
'actions' => [
[
'milliseconds' => 2,
'type' => 'wait'
]
],
'blockAds' => true,
'excludeTags' => [
'<string>'
],
'formats' => [
'markdown'
],
'headers' => [
],
'includeTags' => [
'<string>'
],
'location' => [
'country' => 'US',
'languages' => [
'en-US'
]
],
'lockdown' => false,
'maxAge' => 172800000,
'minAge' => 123,
'mobile' => false,
'onlyCleanContent' => false,
'onlyMainContent' => true,
'parsers' => [
'pdf'
],
'proxy' => 'auto',
'redactPII' => false,
'removeBase64Images' => true,
'skipTlsVerification' => true,
'storeInCache' => true,
'threatProtection' => [
'blacklist' => [
'<string>'
],
'blockedTlds' => [
'<string>'
],
'riskScoreThreshold' => 75,
'whitelist' => [
'<string>'
]
],
'timeout' => 60000,
'waitFor' => 0
],
'sitemap' => 'include',
'zeroDataRetention' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.firecrawl.dev/v2/crawl"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"crawlEntireDomain\": false,\n \"delay\": 123,\n \"excludePaths\": [\n \"<string>\"\n ],\n \"ignoreQueryParameters\": false,\n \"ignoreRobotsTxt\": false,\n \"includePaths\": [\n \"<string>\"\n ],\n \"limit\": 10000,\n \"maxConcurrency\": 123,\n \"maxDiscoveryDepth\": 123,\n \"prompt\": \"<string>\",\n \"regexOnFullURL\": false,\n \"robotsUserAgent\": \"<string>\",\n \"scrapeOptions\": {\n \"actions\": [\n {\n \"milliseconds\": 2,\n \"type\": \"wait\"\n }\n ],\n \"blockAds\": true,\n \"excludeTags\": [\n \"<string>\"\n ],\n \"formats\": [\n \"markdown\"\n ],\n \"headers\": {},\n \"includeTags\": [\n \"<string>\"\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"lockdown\": false,\n \"maxAge\": 172800000,\n \"minAge\": 123,\n \"mobile\": false,\n \"onlyCleanContent\": false,\n \"onlyMainContent\": true,\n \"parsers\": [\n \"pdf\"\n ],\n \"proxy\": \"auto\",\n \"redactPII\": false,\n \"removeBase64Images\": true,\n \"skipTlsVerification\": true,\n \"storeInCache\": true,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000,\n \"waitFor\": 0\n },\n \"sitemap\": \"include\",\n \"zeroDataRetention\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.firecrawl.dev/v2/crawl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"crawlEntireDomain\": false,\n \"delay\": 123,\n \"excludePaths\": [\n \"<string>\"\n ],\n \"ignoreQueryParameters\": false,\n \"ignoreRobotsTxt\": false,\n \"includePaths\": [\n \"<string>\"\n ],\n \"limit\": 10000,\n \"maxConcurrency\": 123,\n \"maxDiscoveryDepth\": 123,\n \"prompt\": \"<string>\",\n \"regexOnFullURL\": false,\n \"robotsUserAgent\": \"<string>\",\n \"scrapeOptions\": {\n \"actions\": [\n {\n \"milliseconds\": 2,\n \"type\": \"wait\"\n }\n ],\n \"blockAds\": true,\n \"excludeTags\": [\n \"<string>\"\n ],\n \"formats\": [\n \"markdown\"\n ],\n \"headers\": {},\n \"includeTags\": [\n \"<string>\"\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"lockdown\": false,\n \"maxAge\": 172800000,\n \"minAge\": 123,\n \"mobile\": false,\n \"onlyCleanContent\": false,\n \"onlyMainContent\": true,\n \"parsers\": [\n \"pdf\"\n ],\n \"proxy\": \"auto\",\n \"redactPII\": false,\n \"removeBase64Images\": true,\n \"skipTlsVerification\": true,\n \"storeInCache\": true,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000,\n \"waitFor\": 0\n },\n \"sitemap\": \"include\",\n \"zeroDataRetention\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/crawl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"crawlEntireDomain\": false,\n \"delay\": 123,\n \"excludePaths\": [\n \"<string>\"\n ],\n \"ignoreQueryParameters\": false,\n \"ignoreRobotsTxt\": false,\n \"includePaths\": [\n \"<string>\"\n ],\n \"limit\": 10000,\n \"maxConcurrency\": 123,\n \"maxDiscoveryDepth\": 123,\n \"prompt\": \"<string>\",\n \"regexOnFullURL\": false,\n \"robotsUserAgent\": \"<string>\",\n \"scrapeOptions\": {\n \"actions\": [\n {\n \"milliseconds\": 2,\n \"type\": \"wait\"\n }\n ],\n \"blockAds\": true,\n \"excludeTags\": [\n \"<string>\"\n ],\n \"formats\": [\n \"markdown\"\n ],\n \"headers\": {},\n \"includeTags\": [\n \"<string>\"\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"lockdown\": false,\n \"maxAge\": 172800000,\n \"minAge\": 123,\n \"mobile\": false,\n \"onlyCleanContent\": false,\n \"onlyMainContent\": true,\n \"parsers\": [\n \"pdf\"\n ],\n \"proxy\": \"auto\",\n \"redactPII\": false,\n \"removeBase64Images\": true,\n \"skipTlsVerification\": true,\n \"storeInCache\": true,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000,\n \"waitFor\": 0\n },\n \"sitemap\": \"include\",\n \"zeroDataRetention\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"success": true,
"url": "<string>"
}{
"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."
}抓取
curl --request POST \
--url https://api.firecrawl.dev/v2/crawl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"allowExternalLinks": false,
"allowSubdomains": false,
"crawlEntireDomain": false,
"delay": 123,
"excludePaths": [
"<string>"
],
"ignoreQueryParameters": false,
"ignoreRobotsTxt": false,
"includePaths": [
"<string>"
],
"limit": 10000,
"maxConcurrency": 123,
"maxDiscoveryDepth": 123,
"prompt": "<string>",
"regexOnFullURL": false,
"robotsUserAgent": "<string>",
"scrapeOptions": {
"actions": [
{
"milliseconds": 2,
"type": "wait"
}
],
"blockAds": true,
"excludeTags": [
"<string>"
],
"formats": [
"markdown"
],
"headers": {},
"includeTags": [
"<string>"
],
"location": {
"country": "US",
"languages": [
"en-US"
]
},
"lockdown": false,
"maxAge": 172800000,
"minAge": 123,
"mobile": false,
"onlyCleanContent": false,
"onlyMainContent": true,
"parsers": [
"pdf"
],
"proxy": "auto",
"redactPII": false,
"removeBase64Images": true,
"skipTlsVerification": true,
"storeInCache": true,
"threatProtection": {
"blacklist": [
"<string>"
],
"blockedTlds": [
"<string>"
],
"riskScoreThreshold": 75,
"whitelist": [
"<string>"
]
},
"timeout": 60000,
"waitFor": 0
},
"sitemap": "include",
"zeroDataRetention": false
}
'import requests
url = "https://api.firecrawl.dev/v2/crawl"
payload = {
"url": "<string>",
"allowExternalLinks": False,
"allowSubdomains": False,
"crawlEntireDomain": False,
"delay": 123,
"excludePaths": ["<string>"],
"ignoreQueryParameters": False,
"ignoreRobotsTxt": False,
"includePaths": ["<string>"],
"limit": 10000,
"maxConcurrency": 123,
"maxDiscoveryDepth": 123,
"prompt": "<string>",
"regexOnFullURL": False,
"robotsUserAgent": "<string>",
"scrapeOptions": {
"actions": [
{
"milliseconds": 2,
"type": "wait"
}
],
"blockAds": True,
"excludeTags": ["<string>"],
"formats": ["markdown"],
"headers": {},
"includeTags": ["<string>"],
"location": {
"country": "US",
"languages": ["en-US"]
},
"lockdown": False,
"maxAge": 172800000,
"minAge": 123,
"mobile": False,
"onlyCleanContent": False,
"onlyMainContent": True,
"parsers": ["pdf"],
"proxy": "auto",
"redactPII": False,
"removeBase64Images": True,
"skipTlsVerification": True,
"storeInCache": True,
"threatProtection": {
"blacklist": ["<string>"],
"blockedTlds": ["<string>"],
"riskScoreThreshold": 75,
"whitelist": ["<string>"]
},
"timeout": 60000,
"waitFor": 0
},
"sitemap": "include",
"zeroDataRetention": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
allowExternalLinks: false,
allowSubdomains: false,
crawlEntireDomain: false,
delay: 123,
excludePaths: ['<string>'],
ignoreQueryParameters: false,
ignoreRobotsTxt: false,
includePaths: ['<string>'],
limit: 10000,
maxConcurrency: 123,
maxDiscoveryDepth: 123,
prompt: '<string>',
regexOnFullURL: false,
robotsUserAgent: '<string>',
scrapeOptions: {
actions: [{milliseconds: 2, type: 'wait'}],
blockAds: true,
excludeTags: ['<string>'],
formats: ['markdown'],
headers: {},
includeTags: ['<string>'],
location: {country: 'US', languages: ['en-US']},
lockdown: false,
maxAge: 172800000,
minAge: 123,
mobile: false,
onlyCleanContent: false,
onlyMainContent: true,
parsers: ['pdf'],
proxy: 'auto',
redactPII: false,
removeBase64Images: true,
skipTlsVerification: true,
storeInCache: true,
threatProtection: {
blacklist: ['<string>'],
blockedTlds: ['<string>'],
riskScoreThreshold: 75,
whitelist: ['<string>']
},
timeout: 60000,
waitFor: 0
},
sitemap: 'include',
zeroDataRetention: false
})
};
fetch('https://api.firecrawl.dev/v2/crawl', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'allowExternalLinks' => false,
'allowSubdomains' => false,
'crawlEntireDomain' => false,
'delay' => 123,
'excludePaths' => [
'<string>'
],
'ignoreQueryParameters' => false,
'ignoreRobotsTxt' => false,
'includePaths' => [
'<string>'
],
'limit' => 10000,
'maxConcurrency' => 123,
'maxDiscoveryDepth' => 123,
'prompt' => '<string>',
'regexOnFullURL' => false,
'robotsUserAgent' => '<string>',
'scrapeOptions' => [
'actions' => [
[
'milliseconds' => 2,
'type' => 'wait'
]
],
'blockAds' => true,
'excludeTags' => [
'<string>'
],
'formats' => [
'markdown'
],
'headers' => [
],
'includeTags' => [
'<string>'
],
'location' => [
'country' => 'US',
'languages' => [
'en-US'
]
],
'lockdown' => false,
'maxAge' => 172800000,
'minAge' => 123,
'mobile' => false,
'onlyCleanContent' => false,
'onlyMainContent' => true,
'parsers' => [
'pdf'
],
'proxy' => 'auto',
'redactPII' => false,
'removeBase64Images' => true,
'skipTlsVerification' => true,
'storeInCache' => true,
'threatProtection' => [
'blacklist' => [
'<string>'
],
'blockedTlds' => [
'<string>'
],
'riskScoreThreshold' => 75,
'whitelist' => [
'<string>'
]
],
'timeout' => 60000,
'waitFor' => 0
],
'sitemap' => 'include',
'zeroDataRetention' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.firecrawl.dev/v2/crawl"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"crawlEntireDomain\": false,\n \"delay\": 123,\n \"excludePaths\": [\n \"<string>\"\n ],\n \"ignoreQueryParameters\": false,\n \"ignoreRobotsTxt\": false,\n \"includePaths\": [\n \"<string>\"\n ],\n \"limit\": 10000,\n \"maxConcurrency\": 123,\n \"maxDiscoveryDepth\": 123,\n \"prompt\": \"<string>\",\n \"regexOnFullURL\": false,\n \"robotsUserAgent\": \"<string>\",\n \"scrapeOptions\": {\n \"actions\": [\n {\n \"milliseconds\": 2,\n \"type\": \"wait\"\n }\n ],\n \"blockAds\": true,\n \"excludeTags\": [\n \"<string>\"\n ],\n \"formats\": [\n \"markdown\"\n ],\n \"headers\": {},\n \"includeTags\": [\n \"<string>\"\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"lockdown\": false,\n \"maxAge\": 172800000,\n \"minAge\": 123,\n \"mobile\": false,\n \"onlyCleanContent\": false,\n \"onlyMainContent\": true,\n \"parsers\": [\n \"pdf\"\n ],\n \"proxy\": \"auto\",\n \"redactPII\": false,\n \"removeBase64Images\": true,\n \"skipTlsVerification\": true,\n \"storeInCache\": true,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000,\n \"waitFor\": 0\n },\n \"sitemap\": \"include\",\n \"zeroDataRetention\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.firecrawl.dev/v2/crawl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"crawlEntireDomain\": false,\n \"delay\": 123,\n \"excludePaths\": [\n \"<string>\"\n ],\n \"ignoreQueryParameters\": false,\n \"ignoreRobotsTxt\": false,\n \"includePaths\": [\n \"<string>\"\n ],\n \"limit\": 10000,\n \"maxConcurrency\": 123,\n \"maxDiscoveryDepth\": 123,\n \"prompt\": \"<string>\",\n \"regexOnFullURL\": false,\n \"robotsUserAgent\": \"<string>\",\n \"scrapeOptions\": {\n \"actions\": [\n {\n \"milliseconds\": 2,\n \"type\": \"wait\"\n }\n ],\n \"blockAds\": true,\n \"excludeTags\": [\n \"<string>\"\n ],\n \"formats\": [\n \"markdown\"\n ],\n \"headers\": {},\n \"includeTags\": [\n \"<string>\"\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"lockdown\": false,\n \"maxAge\": 172800000,\n \"minAge\": 123,\n \"mobile\": false,\n \"onlyCleanContent\": false,\n \"onlyMainContent\": true,\n \"parsers\": [\n \"pdf\"\n ],\n \"proxy\": \"auto\",\n \"redactPII\": false,\n \"removeBase64Images\": true,\n \"skipTlsVerification\": true,\n \"storeInCache\": true,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000,\n \"waitFor\": 0\n },\n \"sitemap\": \"include\",\n \"zeroDataRetention\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/crawl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"allowExternalLinks\": false,\n \"allowSubdomains\": false,\n \"crawlEntireDomain\": false,\n \"delay\": 123,\n \"excludePaths\": [\n \"<string>\"\n ],\n \"ignoreQueryParameters\": false,\n \"ignoreRobotsTxt\": false,\n \"includePaths\": [\n \"<string>\"\n ],\n \"limit\": 10000,\n \"maxConcurrency\": 123,\n \"maxDiscoveryDepth\": 123,\n \"prompt\": \"<string>\",\n \"regexOnFullURL\": false,\n \"robotsUserAgent\": \"<string>\",\n \"scrapeOptions\": {\n \"actions\": [\n {\n \"milliseconds\": 2,\n \"type\": \"wait\"\n }\n ],\n \"blockAds\": true,\n \"excludeTags\": [\n \"<string>\"\n ],\n \"formats\": [\n \"markdown\"\n ],\n \"headers\": {},\n \"includeTags\": [\n \"<string>\"\n ],\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"lockdown\": false,\n \"maxAge\": 172800000,\n \"minAge\": 123,\n \"mobile\": false,\n \"onlyCleanContent\": false,\n \"onlyMainContent\": true,\n \"parsers\": [\n \"pdf\"\n ],\n \"proxy\": \"auto\",\n \"redactPII\": false,\n \"removeBase64Images\": true,\n \"skipTlsVerification\": true,\n \"storeInCache\": true,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 60000,\n \"waitFor\": 0\n },\n \"sitemap\": \"include\",\n \"zeroDataRetention\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"success": true,
"url": "<string>"
}{
"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.
请求体
用于开始爬取的基础 URL
允许爬虫通过链接访问外部网站。
允许爬虫通过链接继续爬取主域名下的子域名。
允许爬虫不仅跟踪子路径,还能跟踪同级或父级的站内链接。
false:只爬取更深层(子级)URL。 → 例如 /features/feature-1 → /features/feature-1/tips ✅ → 不会跟踪 /pricing 或 / ❌
true:会爬取任意站内链接,包括同级和父级。 → 例如 /features/feature-1 → /pricing、/ 等 ✅
如需在嵌套路径之外更广泛地覆盖站内页面,请将其设置为 true。
每次抓取之间的延迟时间(秒)。这有助于遵守网站的限流限制。设置此项会强制将并发数设为 1。
用于将匹配的 URL 排除在爬取之外的 URL 路径名正则表达式模式。例如,如果你为基础 URL firecrawl.dev 设置 "excludePaths": ["blog/.*"],那么所有匹配该模式的结果都会被排除,例如:https://www.firecrawl.dev/blog/firecrawl-launch-week-1-recap。
不要对同一路径使用不同(或没有)查询参数重复抓取
忽略网站的 robots.txt 规则。仅限企业版——如需启用,请联系 support@firecrawl.com。
在抓取过程中用于匹配 URL 的 URL 路径正则表达式规则。只有路径满足这些规则的页面才会包含在响应中。注意:起始 URL 也会基于这些规则进行检查——如果起始 URL 不匹配,本次抓取可能返回 0 个页面。例如,如果你在基础 URL firecrawl.dev/blog 下设置 "includePaths": ["blog/.*"],那么结果中只会包含 /blog/ 下的页面,比如:https://www.firecrawl.dev/blog/firecrawl-launch-week-1-recap。
最大爬取页数。默认值为 10000。
最大并发抓取数量。此参数允许你为本次抓取设置并发上限。如果未指定,则本次抓取将遵循你所在团队的并发限制。
根据页面被发现的顺序设定的最大爬取深度。根站点和 sitemap 中的页面的发现深度为 0。比如,如果你将其设置为 1,并将 sitemap 设置为 'skip',则只会爬取你输入的 URL 以及该页面上链接到的所有 URL。
用于根据自然语言生成爬虫选项(包括下方的所有参数)的提示词。显式指定的参数会覆盖生成的对应参数。
当设为 true 时,includePaths 和 excludePaths 的正则表达式会匹配完整 URL(包括查询参数),而不仅仅是 URL 的路径部分。适用于需要基于查询字符串过滤 URL 的场景。
用于评估 robots.txt 的自定义 User-Agent 字符串。设置后,系统会使用该 User-Agent 获取 robots.txt,并依据它而非默认值匹配允许/禁止规则。仅限企业版——如需启用,请联系 support@firecrawl.com。
Show child attributes
Show child attributes
爬取时的 Sitemap 处理模式。若设置为“skip”,爬虫会忽略站点的 Sitemap,只爬取你提供的起始 URL,并从该页面开始按发现的链接继续爬取。若设置为“only”,爬虫只会根据 Sitemap 中的 URL(加上起始 URL)进行爬取,不会再从页面 HTML 中继续发现并跟进新的链接。
skip, include, only 一个 Webhook 规范对象。
Show child attributes
Show child attributes
如果设置为 true,将为本次抓取任务启用零数据保留。要启用此功能,请联系 help@firecrawl.dev

