Get reviews from google map api

前端 未结 4 1489
名媛妹妹
名媛妹妹 2020-12-13 05:06

I have to get reviews from Google map API. details are on this page.

https://developers.google.com/places/documentation/details#PlaceDetailsResults

the detai

4条回答
  •  余生分开走
    2020-12-13 05:58

    A more recent way to do this:

    https://maps.googleapis.com/maps/api/place/details/json?placeid={place_id}&key={api_key}

    • place_id: https://developers.google.com/places/place-id
    • api_key: https://developers.google.com/places/web-service/get-api-key

    Response:

    {
      "html_attributions": [],
      "result": {
        ...
        "rating": 4.6,
        "reviews": [
          {
            "author_name": "John Smith",
            "author_url": "https://www.google.com/maps/contrib/106615704148318066456/reviews",
            "language": "en",
            "profile_photo_url": "https://lh4.googleusercontent.com/-2t1b0vo3t-Y/AAAAAAAAAAI/AAAAAAAAAHA/0TUB0z30s-U/s150-c0x00000000-cc-rp-mo/photo.jpg",
            "rating": 5,
            "relative_time_description": "in the last week",
            "text": "Great time! 5 stars!",
            "time": 1508340655
          }
        ]
      }
    }
    

    Reviews are limited to the 5 latest.

提交回复
热议问题