基于选项对多个 URL 进行映射
curl --request POST \
--url https://api.firecrawl.dev/v2/map \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ignoreCache": false,
"ignoreQueryParameters": true,
"includeSubdomains": true,
"limit": 5000,
"location": {
"country": "US",
"languages": [
"en-US"
]
},
"search": "<string>",
"sitemap": "include",
"timeout": 60000,
"url": "<string>"
}
'import requests
url = "https://api.firecrawl.dev/v2/map"
payload = {
"ignoreCache": False,
"ignoreQueryParameters": True,
"includeSubdomains": True,
"limit": 5000,
"location": {
"country": "US",
"languages": ["en-US"]
},
"search": "<string>",
"sitemap": "include",
"timeout": 60000,
"url": "<string>"
}
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({
ignoreCache: false,
ignoreQueryParameters: true,
includeSubdomains: true,
limit: 5000,
location: {country: 'US', languages: ['en-US']},
search: '<string>',
sitemap: 'include',
timeout: 60000,
url: '<string>'
})
};
fetch('https://api.firecrawl.dev/v2/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/v2/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([
'ignoreCache' => false,
'ignoreQueryParameters' => true,
'includeSubdomains' => true,
'limit' => 5000,
'location' => [
'country' => 'US',
'languages' => [
'en-US'
]
],
'search' => '<string>',
'sitemap' => 'include',
'timeout' => 60000,
'url' => '<string>'
]),
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/map"
payload := strings.NewReader("{\n \"ignoreCache\": false,\n \"ignoreQueryParameters\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemap\": \"include\",\n \"timeout\": 60000,\n \"url\": \"<string>\"\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/map")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ignoreCache\": false,\n \"ignoreQueryParameters\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemap\": \"include\",\n \"timeout\": 60000,\n \"url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/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 \"ignoreCache\": false,\n \"ignoreQueryParameters\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemap\": \"include\",\n \"timeout\": 60000,\n \"url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"links": [
{
"url": "<string>",
"description": "<string>",
"title": "<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/v2/map \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ignoreCache": false,
"ignoreQueryParameters": true,
"includeSubdomains": true,
"limit": 5000,
"location": {
"country": "US",
"languages": [
"en-US"
]
},
"search": "<string>",
"sitemap": "include",
"timeout": 60000,
"url": "<string>"
}
'import requests
url = "https://api.firecrawl.dev/v2/map"
payload = {
"ignoreCache": False,
"ignoreQueryParameters": True,
"includeSubdomains": True,
"limit": 5000,
"location": {
"country": "US",
"languages": ["en-US"]
},
"search": "<string>",
"sitemap": "include",
"timeout": 60000,
"url": "<string>"
}
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({
ignoreCache: false,
ignoreQueryParameters: true,
includeSubdomains: true,
limit: 5000,
location: {country: 'US', languages: ['en-US']},
search: '<string>',
sitemap: 'include',
timeout: 60000,
url: '<string>'
})
};
fetch('https://api.firecrawl.dev/v2/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/v2/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([
'ignoreCache' => false,
'ignoreQueryParameters' => true,
'includeSubdomains' => true,
'limit' => 5000,
'location' => [
'country' => 'US',
'languages' => [
'en-US'
]
],
'search' => '<string>',
'sitemap' => 'include',
'timeout' => 60000,
'url' => '<string>'
]),
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/map"
payload := strings.NewReader("{\n \"ignoreCache\": false,\n \"ignoreQueryParameters\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemap\": \"include\",\n \"timeout\": 60000,\n \"url\": \"<string>\"\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/map")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ignoreCache\": false,\n \"ignoreQueryParameters\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemap\": \"include\",\n \"timeout\": 60000,\n \"url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/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 \"ignoreCache\": false,\n \"ignoreQueryParameters\": true,\n \"includeSubdomains\": true,\n \"limit\": 5000,\n \"location\": {\n \"country\": \"US\",\n \"languages\": [\n \"en-US\"\n ]\n },\n \"search\": \"<string>\",\n \"sitemap\": \"include\",\n \"timeout\": 60000,\n \"url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"links": [
{
"url": "<string>",
"description": "<string>",
"title": "<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."
}您是需要 Firecrawl API 密钥的 AI 代理吗?请参见 firecrawl.dev/agent-onboarding/SKILL.md 了解自动化入门说明。
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
用于开始爬取的起始 URL
跳过站点地图缓存以获取最新的 URL。站点地图数据最多会被缓存 7 天;如果你刚更新了站点地图,请使用该参数。
不要返回包含查询参数的 URL
包含此网站的子域名
返回的最大链接数量
必填范围:
x <= 100000请求的地域设置。指定后,如果有可用代理,将使用相应代理,并模拟对应的语言和时区设置。若未指定,则默认为“US”。
Show child attributes
Show child attributes
指定搜索查询,以按相关性对结果排序。示例:使用“blog”将返回在 URL 中包含单词“blog”的网址,并按相关性排序。
用于映射(mapping)时的 sitemap 模式。若设置为 skip,则不会使用 sitemap 来发现 URL。若设置为 only,则只会返回出现在 sitemap 中的 URL。默认值为 include,此时会同时使用 sitemap 和其他方式来发现 URL。
可用选项:
skip, include, only 以毫秒为单位的超时时间。默认情况下不设置超时。
⌘I

