后端与接口
当需要用 Google Maps/Places API…
在不想配置 Google Cloud 项目、API key 限制和 Places API 按请求计费时,通过 fetcher.sh 的 HTTP/MCP 接口获取地点搜索、地点详情、评论及本地商户/POI 数据。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 38/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 55/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 59/100 ×0.15
适用场景
当需要用 Google Maps/Pla特定
解决思路
- 使用基础地址 `https://google-maps.fetcher.sh` 作为所有 HTTP 端点前缀。
- 预付费 credits(推荐):访问 `https://fetcher.sh/topup` 或调用 `POST /api/credits/topup` 获取密钥;设置 `export FETCHER_API_KEY="bby_live_xxxxxxxxxxxx"`。
- 预付费请求认证:在 GET 请求中添加请求头 `Authorization: Bearer $FETCHER_API_KEY`。
- x402 按次付费:省略 `Authorization` 头;无支付的 GET 会返回 `402` 及机器可读的支付要求(USDC on Base、Polygon、Arbitrum、Monad 或 Solana);使用 `@x402/fetch` 可自动签名并重试。
- 解析统一响应:每个响应为 `{ "status": number, "message": string, "data": ... }`;HTTP status 与 `status` 一致。
- 调用 `/api/place/search`:接受文本查询并返回匹配地点,可选锚定到坐标。
- 调用 `/api/place/{fid}`:按 feature ID 返回地点完整详情。
- 调用 `/api/place/{fid}/reviews`:返回某地点评论。
- 调用 `/api/review/{id}`:按 ID 返回单条评论。
- 所有 4 个端点均为 GET,每次调用 $0.005。
- 搜索端点必填 `query`;可选 `languageCode`、`countryCode`、`latitude`、`longitude`、`offset`、`zoom`(搜索半径/精度)。
- 评论端点支持 `sort`(`relevant`、`newest`、`highest`、`lowest`)和 `cursor`。
- 纯文本搜索:执行 `curl -H "Authorization: Bearer $FETCHER_API_KEY" --data-urlencode "query=ramen in brooklyn" -G "https://google-maps.fetcher.sh/api/place/search"`。
- 坐标锚定搜索(用于 “near me” 风格查询):执行 `curl -H "Authorization: Bearer $FETCHER_API_KEY" --data-urlencode "query=coffee" -G --data-urlencode "latitude=40.7128" --data-urlencode "longitude=-74.0060" "https://google-maps.fetcher.sh/api/place/search"`。
- 获取地点详情再按最新排序评论:先 GET `https://google-maps.fetcher.sh/api/place/0x89c259af336b3341%3A0x8c584d6dfe89aa89`,再执行 `curl -H "Authorization: Bearer $FETCHER_API_KEY" --data-urlencode "sort=newest" -G "https://google-maps.fetcher.sh/api/place/0x89c259af336b3341%3A0x8c584d6dfe89aa89/reviews"`。
- 按 ID 获取单条评论:执行 `curl -H "Authorization: Bearer $FETCHER_API_KEY" "https://google-maps.fetcher.sh/api/review/ChdDSUhNMG9nS0VJQ0FnSURDeGRXQnl3RRAB"`。
- 本地化结果:执行 `curl -H "Authorization: Bearer $FETCHER_API_KEY" --data-urlencode "query=boulangerie" -G --data-urlencode "languageCode=fr" --data-urlencode "countryCode=CA" "https://google-maps.fetcher.sh/api/place/search"`。
- 配置 MCP:在 `mcpServers` 中添加 `google-maps`,`url` 为 `https://google-maps.fetcher.sh/mcp`,`headers` 为 `{ "Authorization": "Bearer bby_live_..." }`。
- 使用 MCP 免费工具:`search_endpoints`、`describe_endpoint`、`check_balance`。
- 使用 MCP 付费工具:`fetch_data`(可调用任意上述端点)、`topup_credits`,以及命名快捷方式 `google_maps_place_search`。
- 若要 MCP 改用 x402 按次付费:删除 `headers` 块,并按 fetcher skill 的完整流程操作。
- 处理错误:`400` 表示缺少/无效参数(message 会指出参数名);`401` 表示未知或轮换的密钥;`402` 表示需要支付(x402 challenge)或 `topup_required`(credits 耗尽);`404` 表示不是计价路径。
- 注意调用限制与退款:无速率限制;上游失败不退款(结算先于交付)。
- 查阅参考文档:完整 agent 设置 `https://google-maps.fetcher.sh/skill.md`,OpenAPI 3.1 契约 `https://google-maps.fetcher.sh/openapi.json`,精简目录 `https://google-maps.fetcher.sh/llms.txt`,支付、credits、MCP 深入说明见 fetcher skill,站点 `https://google-maps.fetcher.sh`。
适用边界 · 注意事项
- 不适用需要 Google 官方 Maps/Places API 的完整功能、官方 SLA 或 Google Cloud 原生计费/配额管理的场景。
- 不适用不能或不愿使用 fetcher.sh、预付费 credits、x402/USDC 付款,或需要上游失败退款保障的场景。
- 不适用需要本技能未提供的端点(如路线规划、地理编码、距离矩阵等)的场景。