google-places-api

From Google Maps CID to Place ID


I have a bunch of links to google maps in the form of https://maps.google.com/?cid=<identifier>.

How can you go from that CID to a Place ID that can be used with the Google Places API? Is there any API endpoint that you can use to convert these URLs into the new places?


Solution

  • Got lucky and found an undocumented api. If you have the CID, you can call the api like https://maps.googleapis.com/maps/api/place/details/json?cid=${CID}&key=YOUR_API_KEY.

    I just changed place_id=${the_end_val_i_needed} to cid=${CID} and in the json response is the place_id.