基于选项对多个 URL 进行映射
curl --request POST \
--url https://api.firecrawl.dev/v1/map \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"ignoreSitemap": true,
"includeSubdomains": true,
"limit": 5000,
"location": {
"country": "US",
"languages": [
"en-US"
]
},
"search": "<string>",
"sitemapOnly": false,
"threatProtection": {
"blacklist": [
"<string>"
],
"blockedTlds": [
"<string>"
],
"riskScoreThreshold": 75,
"whitelist": [
"<string>"
]
},
"timeout": 123
}
'import requests
url = "https://api.firecrawl.dev/v1/map"
payload = {
"url": "<string>",
"ignoreSitemap": True,
"includeSubdomains": True,
"limit": 5000,
"location": {
"country": "US",
"languages": ["en-US"]
},
"search": "<string>",
"sitemapOnly": False,
"threatProtection": {
"blacklist": ["<string>"],
"blockedTlds": ["<string>"],
"riskScoreThreshold": 75,
"whitelist": ["<string>"]
},
"timeout": 123
}
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>',
ignoreSitemap: true,
includeSubdomains: true,
limit: 5000,
location: {country: 'US', languages: ['en-US']},
search: '<string>',
sitemapOnly: false,
threatProtection: {
blacklist: ['<string>'],
blockedTlds: ['<string>'],
riskScoreThreshold: 75,
whitelist: ['<string>']
},
timeout: 123
})
};
fetch('https://api.firecrawl.dev/v1/map', 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/v1/map",
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>',
'ignoreSitemap' => true,
'includeSubdomains' => true,
'limit' => 5000,
'location' => [
'country' => 'US',
'languages' => [
'en-US'
]
],
'search' => '<string>',
'sitemapOnly' => false,
'threatProtection' => [
'blacklist' => [
'<string>'
],
'blockedTlds' => [
'<string>'
],
'riskScoreThreshold' => 75,
'whitelist' => [
'<string>'
]
],
'timeout' => 123
]),
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/v1/map"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"ignoreSitemap\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemapOnly\": false,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 123\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/v1/map")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"ignoreSitemap\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemapOnly\": false,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v1/map")
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 \"ignoreSitemap\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemapOnly\": false,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 123\n}"
response = http.request(request)
puts response.read_body{
"links": [
"<string>"
],
"success": true
}{
"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."
}映射端点
Map
POST
/
map
基于选项对多个 URL 进行映射
curl --request POST \
--url https://api.firecrawl.dev/v1/map \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"ignoreSitemap": true,
"includeSubdomains": true,
"limit": 5000,
"location": {
"country": "US",
"languages": [
"en-US"
]
},
"search": "<string>",
"sitemapOnly": false,
"threatProtection": {
"blacklist": [
"<string>"
],
"blockedTlds": [
"<string>"
],
"riskScoreThreshold": 75,
"whitelist": [
"<string>"
]
},
"timeout": 123
}
'import requests
url = "https://api.firecrawl.dev/v1/map"
payload = {
"url": "<string>",
"ignoreSitemap": True,
"includeSubdomains": True,
"limit": 5000,
"location": {
"country": "US",
"languages": ["en-US"]
},
"search": "<string>",
"sitemapOnly": False,
"threatProtection": {
"blacklist": ["<string>"],
"blockedTlds": ["<string>"],
"riskScoreThreshold": 75,
"whitelist": ["<string>"]
},
"timeout": 123
}
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>',
ignoreSitemap: true,
includeSubdomains: true,
limit: 5000,
location: {country: 'US', languages: ['en-US']},
search: '<string>',
sitemapOnly: false,
threatProtection: {
blacklist: ['<string>'],
blockedTlds: ['<string>'],
riskScoreThreshold: 75,
whitelist: ['<string>']
},
timeout: 123
})
};
fetch('https://api.firecrawl.dev/v1/map', 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/v1/map",
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>',
'ignoreSitemap' => true,
'includeSubdomains' => true,
'limit' => 5000,
'location' => [
'country' => 'US',
'languages' => [
'en-US'
]
],
'search' => '<string>',
'sitemapOnly' => false,
'threatProtection' => [
'blacklist' => [
'<string>'
],
'blockedTlds' => [
'<string>'
],
'riskScoreThreshold' => 75,
'whitelist' => [
'<string>'
]
],
'timeout' => 123
]),
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/v1/map"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"ignoreSitemap\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemapOnly\": false,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 123\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/v1/map")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"ignoreSitemap\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemapOnly\": false,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v1/map")
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 \"ignoreSitemap\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemapOnly\": false,\n \"threatProtection\": {\n \"blacklist\": [\n \"<string>\"\n ],\n \"blockedTlds\": [\n \"<string>\"\n ],\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"<string>\"\n ]\n },\n \"timeout\": 123\n}"
response = http.request(request)
puts response.read_body{
"links": [
"<string>"
],
"success": true
}{
"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."
}注意:本 API 的全新 v2 版本 现已发布,具备更强大的功能和更高的性能。
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
开始爬取时使用的基础 URL
抓取网站时忽略其 sitemap。
包含该网站子域名
要返回的最大链接数
必填范围:
x <= 30000请求的地理位置设置。指定后(如果可用),将使用相应的代理,并模拟对应的语言和时区设置。如果未指定,默认值为“US”。
Show child attributes
Show child attributes
用于映射的搜索查询。在 Alpha 阶段,搜索功能中的「智能」部分最多只会处理 500 条搜索结果。不过,如果 Map 找到更多结果,则不会对这些结果施加任何限制。
仅返回网站站点地图中包含的链接
超时时间(毫秒)。默认情况下没有超时限制。
⌘I

