BazaarLinkBazaarLink
登入
文件API 参考SDK 参考Agent 应用AI Skills
网络搜索

建立网站地图

从根 URL 探索网站链接图并返回发现的 URL。这是仅用于 discovery 的端点,不包含内容提取字段。支持 Bearer API 密钥,也支持将 api_key 放在 JSON body 中作为兼容性回退;https://api.bazaarlink.ai/v1 和 https://bazaarlink.ai/api/v1 均可使用。未知字段会被忽略。响应包含 base_url、URL 字符串数组 results、response_time、我们附加的 usage.credits 和 usage.cost(credits 乘以管理员设置的每 credit 价格)以及 request_id。 每 10 个成功页面基本收取 1 credit;提供 instructions 时为 2 credits。失败页面免费。实际 credits 从共享每日免费额度扣除;如果根据 limit 的估算超过剩余额度,超出部分从余额计费;没有余额则返回 432 并建议降低 limit。 SDK 示例;请将密钥放在环境变量或其他安全的服务端配置中。 Python: from tavily import TavilyClient client = TavilyClient(api_key="...", api_base_url="https://api.bazaarlink.ai/v1") response = client.map("docs.tavily.com") JavaScript: import { tavily } from "@tavily/core" const tvly = tavily({ apiKey: process.env.BAZAARLINK_API_KEY, apiBaseURL: "https://api.bazaarlink.ai/v1" }) const response = await tvly.map("docs.tavily.com")

POST/v1/map

验证

Authorization必填
string · header

在 Authorization 标头以 Bearer token 传入 API 密钥。

Body

url必填
string

开始建立地图的根 URL;可以省略 scheme,例如 docs.tavily.com。

required; scheme optional
Example: "docs.tavily.com"
instructions
string

告诉探索器要查找的内容;提供后每 10 个成功页面的 mapping 成本为 2 credits,而不是 1。

Example: "Find Python SDK pages"
max_depth
integer

建立地图的最大深度,范围 1–5,默认 1。

1-5; default: 1
Example: 1
max_breadth
integer

每层每页最多跟随的链接数,范围 1–500,默认 20。

1-500; default: 20
Example: 20
limit
integer

停止前处理的链接总数,最小 1,默认 50。

minimum: 1; default: 50
Example: 50
select_paths
string[]

路径选择 的正则表达式数组;最多 50 个条目,每个表达式最多 200 个字符。

max 50 entries; max 200 characters per regex
Example: ["^/docs/.*"]
select_domains
string[]

域名选择 的正则表达式数组;最多 50 个条目,每个表达式最多 200 个字符。

max 50 entries; max 200 characters per regex
Example: ["^docs\.example\.com$"]
exclude_paths
string[]

路径排除 的正则表达式数组;最多 50 个条目,每个表达式最多 200 个字符。

max 50 entries; max 200 characters per regex
Example: ["^/private/.*"]
exclude_domains
string[]

域名排除 的正则表达式数组;最多 50 个条目,每个表达式最多 200 个字符。

max 50 entries; max 200 characters per regex
Example: ["^private\.example\.com$"]
allow_external
boolean

是否将外部域名链接纳入结果,默认 true。

default: true
Example: true
timeout
number

等待建立地图的秒数。Tavily 范围为 10–150,但 BazaarLink 的有效上限是 90 秒;超过 90 会降低到 90。

Tavily: 10-150; BazaarLink default/effective maximum: 90 seconds; values above 90 are lowered to 90
Example: 90
include_usage
boolean

是否在响应中包含 usage,默认 false;包含时会显示 credits 和 usage.cost。

default: false
Example: false
POST /v1/map
curl https://api.bazaarlink.ai/v1/map   -H "Authorization: Bearer $BAZAARLINK_API_KEY"   -H "Content-Type: application/json"   -d '{
    "url": "docs.tavily.com",
    "instructions": "Find Python SDK pages",
    "limit": 20,
    "timeout": 90,
    "include_usage": true
  }'
响应示例

建立地图成功。results 是发现的 URL 字符串;每 10 个成功页面基本成本为 1 credit,提供 instructions 时为 2 credits。

{
  "base_url": "docs.tavily.com",
  "results": [
    "https://docs.tavily.com/welcome",
    "https://docs.tavily.com/documentation/api-credits"
  ],
  "response_time": 1.23,
  "usage": {
    "credits": 1,
    "cost": 0.01
  },
  "request_id": "map_123e4567-e89b-12d3-a456-426614174111"
}
客服
客服
您好!有什么可以协助?
请留下消息,我们会尽快回复。