API 参考

Google 评价链接 API

将一个 Google 地图网址转换为直接评价链接。无需注册或 Google API 密钥。

  1. 请求

    application/json { "maps_url": "https://www.google.com/maps/place/PRODUCTMATE/data=!1s0x47b18f1cae867bab:0xb6f8b3a3753ba1a2!8m2" }
  2. POST /api/v1/google-review-link productmate.com
  3. 响应 200

    application/json { "place_id": "ChIJq3uGrhyPsUcRoqE7daOz-LY", "review_url": "https://search.google.com/local/writereview?placeid=ChIJq3uGrhyPsUcRoqE7daOz-LY", "verification": "not_verified" }
POST/api/v1/google-review-link

支持的输入

  • 特定地点的完整 Google 地图网址
  • maps.app.goo.gl 分享链接
  • 旧版 goo.gl/maps 分享链接

请求

向端点发送一个 JSON 对象。不接受商家名称或单独的 Place ID。

curl -X POST https://productmate.com/api/v1/google-review-link \
  -H "Content-Type: application/json" \
  -d '{"maps_url":"https://www.google.com/maps/place/PRODUCTMATE/data=!1s0x47b18f1cae867bab:0xb6f8b3a3753ba1a2!8m2"}'

响应

{
  "place_id": "ChIJq3uGrhyPsUcRoqE7daOz-LY",
  "review_url": "https://search.google.com/local/writereview?placeid=ChIJq3uGrhyPsUcRoqE7daOz-LY",
  "verification": "not_verified"
}

verification 始终为 not_verified。将链接交给用户前,请核对地点。

错误和处理方法

  • invalid_request (400)
    发送包含非空 maps_url 的有效 JSON。
  • unsupported_url (422)
    使用 Google 地图中特定商家的分享链接。
  • unsafe_redirect (422)
    使用仅重定向到 Google 地图的分享链接。
  • upstream_unresolved (502)
    打开短链接并发送最终的完整地图网址。
  • upstream_timeout (504)
    请稍候并重试一次,或发送最终的完整地图网址。

使用限制

匿名限制约为每个客户端 IP 每分钟 20 次请求。共用 IP 的智能体会共用此限额。

Content-Length: 16 KiB
maps_url: 8 KiB
short_url_resolution_deadline: 10 s

边缘生成的 429 响应可能不含 JSON 内容或 Retry-After 标头。请至少等待 60 秒,并逐次增加等待时间。

获取正确的地图网址

  1. 在 Google 地图中打开准确的商家地点。
  2. 核对分店名称和地址,然后选择分享。
  3. 复制链接,并将其作为 maps_url 发送。

数据使用

成功的调用会记录地点标识符、语言、时间以及可用时的商家大致位置。解析后的短链接会缓存24小时。