← 返回接入教程
POST

/api/proxy/map · Map 站点地图

从一个起始 URL 开始,按深度遍历站点结构,只返回 URL + 标题(不抓正文),适合先探清结构再按需 extract/crawl。

请求参数
参数
类型
说明
url*
string起始 URL,作为映射入口
max_depth
integer最大映射深度,默认 1,范围 1-5
max_breadth
integer每层最多跟随的链接数,默认 50,范围 1-500
limit
integer本次映射返回的链接总数上限,默认 50
instructions
string自然语言过滤指令,聚焦相关页面(启用后每 10 URL 扣 2 credits)
select_paths
array只映射路径匹配任一 regex 的链接
exclude_paths
array跳过路径匹配任一 regex 的链接
allow_external
boolean是否允许映射到站外链接,默认 true
代码示例
cURL
Python
JavaScript
Go
curl -X POST https://tavily.sharyuke.com/api/proxy/map \
  -H "Authorization: Bearer thb-xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com", "max_depth": 2, "limit": 50, "select_paths": ["/docs/.*"] }'
响应示例
{ "code": 0, "message": "ok", "data": { "ok": true, "data": { "base_url": "https://example.com", "results": [{ "url": "https://example.com/docs/intro", "title": "Introduction" }, { "url": "https://example.com/docs/api" }], "response_time": 0.6 }, "credits": 1 } }
错误码
错误码
含义
处理建议
400请求参数错误检查请求体字段
401API Key 无效检查 Authorization 头
429超过速率限制降低请求频率
500内部错误稍后重试或联系支持
503上游服务不可用网关已自动重试,请稍候

准备好接入了吗?

邮箱注册即可免费使用,每月 7,200 次免费调用,无需信用卡。