开发者:API、MCP、CLI
三种接口都只读、读同一份数据,每条结果都带有网站对应页面的链接。公开 API、CLI 和本地 MCP 免登录;远程 MCP 需要用 Google 或 X 账号登录后使用(免费)。使用时请注明出处 bestjapanbuy.com(见使用条款)。
公开 API
构建时生成的静态 JSON,基础地址 https://bestjapanbuy.com/api/v1/。数据更新至 2026-10-24(dataVersion 2026.10.24)。
| 接口 | 内容 |
|---|---|
GET /api/v1/meta.json打开 | 数据更新日期和版本号(dataVersion)、汇率、税率、免税规则版本、“值不值”判断标准 |
GET /api/v1/categories.json打开 | 品类列表及专属属性定义、品牌表 |
GET /api/v1/products/{品类}.json示例 | 某品类全部型号(含价格、评价、兼容性和值不值结论) |
GET /api/v1/product/{型号id}.json示例 | 单个型号完整信息 |
GET /api/v1/stores.json打开 | 门店、车站、连锁品牌 |
GET /api/v1/rules.json打开 | 兼容性规则(目的地、检查项、规则)和免税规则 |
GET /search-index.json打开 | 站内搜索索引 |
每个对象都包含页面链接(url)、来源(source)和日期字段;响应中的 attribution 说明署名要求。另有 Markdown 版本:/p/{型号id}.md、/q/{slug}.md,以及 /llms.txt、/llms-full.txt(全部型号的价格和各地结论)。
curl https://bestjapanbuy.com/api/v1/products/rice-cooker.json MCP 服务
远程版(Streamable HTTP):https://mcp.bestjapanbuy.com/mcp。需要登录:第一次添加时,AI 工具会打开浏览器,你在 bestjapanbuy.com 用 Google 或 X 账号登录并点“授权”即可,之后工具会自动续期。已授权的工具可以在 我的 页面查看和撤销。
Claude Code
claude mcp add --transport http bestjapanbuy https://mcp.bestjapanbuy.com/mcp 添加后在 Claude Code 里运行 /mcp,选择 bestjapanbuy → Authenticate,浏览器会打开登录和授权页面。
Claude Desktop、claude.ai
在“设置 → 连接器”中添加自定义连接器,填入 https://mcp.bestjapanbuy.com/mcp,点“连接”后按提示登录授权。
Cursor
在 ~/.cursor/mcp.json(或项目的 .cursor/mcp.json)中添加,保存后在 MCP 设置里点 Connect / Login:
{
"mcpServers": {
"bestjapanbuy": {
"url": "https://mcp.bestjapanbuy.com/mcp"
}
}
} 本地版(免登录)
npx -y https://bestjapanbuy.com/cli/bestjapanbuy-latest.tgz mcp 本地版以 stdio 运行,读取公开 API,不需要登录。可用环境变量 BESTJAPANBUY_API 指定其他 API 地址。Claude Desktop 的 claude_desktop_config.json 写法:
{
"mcpServers": {
"bestjapanbuy": {
"command": "npx",
"args": [
"-y",
"https://bestjapanbuy.com/cli/bestjapanbuy-latest.tgz",
"mcp"
]
}
}
} 授权细节(给自己写客户端的开发者)
- 按 MCP 授权规范实现:OAuth 2.1 授权码 + PKCE(S256),
resource参数必须是https://mcp.bestjapanbuy.com/mcp。 - 未带凭证的请求返回
401,WWW-Authenticate中的resource_metadata指向 Protected Resource Metadata:https://mcp.bestjapanbuy.com/.well-known/oauth-protected-resource/mcp。 - 授权服务器
https://bestjapanbuy.com/auth,元数据https://bestjapanbuy.com/.well-known/oauth-authorization-server/auth。客户端身份支持 Client ID Metadata Documents,也保留动态客户端注册(/auth/oauth2/register)兼容旧客户端。 - access token 为 JWT,有效期 10 分钟,用 refresh token 续期;撤销授权后 refresh token 立即失效。
- 限流:登录用户每人每分钟 120 次;未登录或凭证无效的请求按 IP 每分钟 60 次。
工具列表
| 工具 | 输入 | 输出 |
|---|---|---|
search_products | 品类、版本、价格区间、品牌、专属属性、关键词 | 型号列表(含价格、值不值、页面链接) |
get_product | 型号id 或型号字符串(容错匹配) | 完整信息 |
compare_products | 2–3个型号id | 并排规格和差异 |
check_compatibility | 型号id 或品类、目的地国家/地区 | 电压、插头、登机等逐项结论 |
worth_it | 型号id,可选汇率 | 日本到手价、国内价、结论和计算过程 |
find_stores | 经纬度或车站名、可选品类 | 最近门店列表及导航链接 |
calc_tax_refund | 价格、是否含税、汇率、购买日期 | 免税价、退税额、人民币、适用规则 |
get_tax_free_rules | 购买日期 | 当时适用的免税规则和流程 |
CLI
命令 bestjapanbuy,短别名 bjb。需要 Node.js 18 及以上,默认输出中文表格,加 --json 输出 JSON。CLI 暂未发布到 npm 仓库,安装包放在我们的网站上:https://bestjapanbuy.com/cli/bestjapanbuy-latest.tgz,随网站每次部署更新。
不安装、直接运行:
npx -y https://bestjapanbuy.com/cli/bestjapanbuy-latest.tgz search rice-cooker --version overseas --budget 60000
npx -y https://bestjapanbuy.com/cli/bestjapanbuy-latest.tgz show NW-YQH10
npx -y https://bestjapanbuy.com/cli/bestjapanbuy-latest.tgz compat hair-dryer --to CN
npx -y https://bestjapanbuy.com/cli/bestjapanbuy-latest.tgz refund 63600 --fx 0.0425
npx -y https://bestjapanbuy.com/cli/bestjapanbuy-latest.tgz mcp # 启动本地 MCP 服务(stdio) 常用的话可以全局安装,之后直接用 bjb:
npm install -g https://bestjapanbuy.com/cli/bestjapanbuy-latest.tgz
bjb search rice-cooker --version overseas --budget 60000
bjb show NW-YQH10
bjb compare NW-YQH10 JPK-W10W
bjb worth NW-YQH10
bjb stores --near shinjuku 使用条款摘要
- 免费使用,需注明出处“BestJapanBuy(bestjapanbuy.com)”并尽量链接到对应页面。
- 服务端有访问频率限制,请缓存结果、合理请求。远程 MCP 按账号限流,请不要共享或转售授权。
- 价格仅供参考,以店铺为准;第三方评分不得标为你或我们的评分。