跳转到主要内容
POST
/
map
基于选项对多个 URL 进行映射
curl --request POST \
  --url https://api.firecrawl.dev/v2/map \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "search": "<string>",
  "sitemap": "include",
  "includeSubdomains": true,
  "ignoreQueryParameters": true,
  "limit": 5000,
  "location": {
    "country": "US",
    "languages": [
      "en-US"
    ]
  },
  "timeout": 60000
}
'
{
  "success": true,
  "links": [
    {
      "url": "<string>",
      "title": "<string>",
      "description": "<string>"
    }
  ]
}

v2 的新功能

更灵活的 Sitemap 控制

处理 Sitemap 的三种方式:
  • "include" - 使用 Sitemap 并发现其他页面(默认)
  • "skip" - 完全忽略 Sitemap
  • "only" - 只返回来自 Sitemap 的 URL
{
  "url": "https://example.com",
  "sitemap": "only"
}

响应格式已更改

我们现在会在 links 对象数组中返回链接,并附带增强的元数据。
{
  "url": "https://example.com",
  "links": [
    {
      "url": "https://example.com/page1",
      "title": "Page 1",
      "description": "Page 1 description"
    }
  ]
}

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
url
string<uri>
必填

用于开始爬取的起始 URL

指定搜索查询,以按相关性对结果排序。示例:使用“blog”将返回在 URL 中包含单词“blog”的网址,并按相关性排序。

sitemap
enum<string>
默认值:include

用于映射(mapping)时的 sitemap 模式。若设置为 skip,则不会使用 sitemap 来发现 URL。若设置为 only,则只会返回出现在 sitemap 中的 URL。默认值为 include,此时会同时使用 sitemap 和其他方式来发现 URL。

可用选项:
skip,
include,
only
includeSubdomains
boolean
默认值:true

包含此网站的子域名

ignoreQueryParameters
boolean
默认值:true

不要返回包含查询参数的 URL

limit
integer
默认值:5000

返回的最大链接数量

必填范围: x <= 100000
timeout
integer

以毫秒为单位的超时时间。默认情况下不设置超时。

location
object

请求的地域设置。指定后,如果有可用代理,将使用相应代理,并模拟对应的语言和时区设置。若未指定,则默认为“US”。

响应

成功响应

success
boolean