Where I can find a place id on google maps

怎甘沉沦 提交于 2019-12-18 21:19:29

问题


I want to get the place images accord to the introductions here:

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

According this document I need the "place id" of the place.

https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=AddYourOwnKeyHere

Where can I find the placeid


回答1:


The place_id is in the SearchResults from any of the SearchRequests:

from the documentation:

{
   "html_attributions" : [],
   "results" : [
      {
         "geometry" : {
            "location" : {
               "lat" : -33.870775,
               "lng" : 151.199025
            }
         },
         "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/travel_agent-71.png",
         "id" : "21a0b251c9b8392186142c798263e289fe45b4aa",
         "name" : "Rhythmboat Cruises",
         "opening_hours" : {
            "open_now" : true
         },
         "photos" : [
            {
               "height" : 270,
               "html_attributions" : [],
               "photo_reference" : "CnRnAAAAF-LjFR1ZV93eawe1cU_3QNMCNmaGkowY7CnOf-kcNmPhNnPEG9W979jOuJJ1sGr75rhD5hqKzjD8vbMbSsRnq_Ni3ZIGfY6hKWmsOf3qHKJInkm4h55lzvLAXJVc-Rr4kI9O1tmIblblUpg2oqoq8RIQRMQJhFsTr5s9haxQ07EQHxoUO0ICubVFGYfJiMUPor1GnIWb5i8",
               "width" : 519
            }
         ],
         "place_id" : "ChIJyWEHuEmuEmsRm9hTkapTCrk",  // <----------------------------------------------
         "scope" : "GOOGLE",
         "alt_ids" : [
            {
               "place_id" : "D9iJyWEHuEmuEmsRm9hTkapTCrk",
               "scope" : "APP"
            }
         ],



回答2:


You should be able to find a place ID here: https://developers.google.com/places/place-id#find-id




回答3:


The above solution works in most cases but sometimes fails when you have some individuals using the same address as a business. In case you have exhausted the options from the API and manual search provided in the Google documentation Here Or here

You can use the manual suggestion provided at this page which has always worked for me https://www.launch2success.com/guide/cant-find-google-places-id-trick-finding-google-places-id/




回答4:


You may want a Place ID Text search by searching the place name.

Your sample request may look like

https://maps.googleapis.com/maps/api/place/textsearch/json?query=fish+market+sydney&key="YOUR_API_KEY"

You will find the "place_id" in the return JSON String.



来源:https://stackoverflow.com/questions/25030507/where-i-can-find-a-place-id-on-google-maps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!