Code Wiget
Code Wiget

Reputation: 1672

Get place_id from google maps url

A client has given me a giant list of google URLs, and they would like me to get the business name, address, and phone numbers of each location.

They found the URLs using the google maps website, selected location, pressed "share", and copied the link.

The links look something like this.

They resolve to URLs like this.

Is there any way to get the place ID from this page? From there, I can retrieve the details I need. I basically need to do the exact opposite of Getting Google Maps link from place_id

Upvotes: 1

Views: 1105

Answers (1)

Code Wiget
Code Wiget

Reputation: 1672

Found the answer, albeit a poor one. Pull the latitude and longitude from the URL, then use Google’s place search, and search using the query="category", location=lat/long. Category is the general search term of the type of establishment you're searching, such as "barbershop". Pull the lat/long from the very end of the resolved URL: 35.065461, -80.773431. Google will return plenty of results, but the first one should be the one you're looking for. The result will contain the place ID.

Upvotes: 1

Related Questions