【问题标题】:Google Places API Return PostcodeGoogle Places API 返回邮政编码
【发布时间】:2020-12-13 18:05:55
【问题描述】:

我正在尝试获取返回的 Google Places API 的邮政编码。

我到处寻找,但似乎找不到人们如何做到这一点的有效示例。

这是我在 Postman 中运行良好的 API:

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Sydney&region=AU&key=xxxxx&libraries=places

这是示例 JSON 响应

{
   "predictions": [
      {
         "description": "xxxxx",
         "place_id": "xxx",
         "reference": "xxx",
         "structured_formatting": {
            "main_text": "xxx",
            "main_text_matched_substrings": [
               {
                  "length": 2,
                  "offset": 0
               },
   ],
   "status": "OK"
}

如何获取邮政编码详细信息?

【问题讨论】:

    标签: c# json api google-maps google-maps-api-3


    【解决方案1】:

    没关系,找到解决办法了。

    需要使用另一个 API 端点并像这样插入 place_id:

    https://maps.googleapis.com/maps/api/place/details/json?region=AU&key=xxx&place_id=xxxx
    

    【讨论】:

      猜你喜欢
      • 2018-05-26
      • 1970-01-01
      • 2012-08-02
      • 1970-01-01
      • 2011-05-19
      • 2018-10-17
      • 2015-04-12
      • 1970-01-01
      • 2018-11-02
      相关资源
      最近更新 更多