API 与 MCP

让 Claude、ChatGPT / OpenAI 或任何 MCP 客户端在任务中直接调用外链成本查询。

MCP 地址
https://your-site/api/mcp
Streamable HTTP · MCP 2025-06-18 / 2026-07-28
鉴权

使用邀请码(Bearer Token 或 URL 中的 key 参数),或通过请求头 X-DFS-Login / X-DFS-Password 使用你自己的 DataForSEO 账号。

你的邀请码: — · 在设置中填写邀请码后,下方示例会自动带上。

客户端配置

claude mcp add --transport http linkcost https://your-site/api/mcp \
  --header "Authorization: Bearer YOUR_INVITE_CODE"

可用工具

estimate_query_cost

查询目标站引用域总数,并估算不同拉取数量的 DataForSEO 费用(约 $0.024)

analyze_linkcost

docs.toolDesc.analyze_linkcost

batch_analyze_linkcost

docs.toolDesc.batch_analyze_linkcost

get_report

读取已生成的报告,可按已匹配 / 可免费 / 未匹配筛选明细

lookup_domain_price

查询单个域名在价格库中的全部报价(不消耗额度)

check_credit

查看邀请码剩余额度

REST API

POST /api/estimate
curl -X POST https://your-site/api/estimate \
  -H "content-type: application/json" \
  -H "x-invite-code: YOUR_INVITE_CODE" \
  -d '{"target":"example.com"}'
POST /api/analyze
curl -X POST https://your-site/api/analyze \
  -H "content-type: application/json" \
  -H "x-invite-code: YOUR_INVITE_CODE" \
  -d '{"target":"example.com","limit":1000}'   # limit: 10–100000 or "all"
GET /api/invite
curl https://your-site/api/invite -H "x-invite-code: YOUR_INVITE_CODE"