Mosh Feu
Mosh Feu

Reputation: 29277

Where can I find a place id on Google Maps?

I want to get the place images according to the instructions here.

According to 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?

Upvotes: 17

Views: 52282

Answers (5)

Ketaki Dabekar
Ketaki Dabekar

Reputation: 1

Maybe try the TextSeach option or else try the Nearbysearch option which I have mentioned below maybe it works for you.

1.https://maps.googleapis.com/maps/api/place/nearbysearch/json?query={address}&key={_apiConfig.Key}

2.https://maps.googleapis.com/maps/api/place/textsearch/json?query={address}&key={_apiConfig.Key}

In response, you will get all information with a place id which is help full.

Upvotes: 0

hina
hina

Reputation: 41

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/

Upvotes: 4

Man Coding
Man Coding

Reputation: 451

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.

Upvotes: 2

Liz Lam
Liz Lam

Reputation: 171

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

Upvotes: 17

geocodezip
geocodezip

Reputation: 161334

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"
            }
         ],

Upvotes: 9

Related Questions