Porchy Web Development

Getting the placeid, latitude and longitude for the Google Maps Javascript API

Need the place id or anything from the Places Search results for whatever you’re doing with the Google Maps API?

I got mine using the Google Places API Text Search Service:  https://developers.google.com/places/documentation/search#TextSearchRequests

If you put in your API key and an address in the following url, you’ll get what you need for the Google Maps Javascript API or wherever else. This includes placeid (in the results as place_id), latitude and longitude. You can use any text query in place of the postcode I used, just replace the spaces with + or %20 (either will encode the space for use in the url).

https://maps.googleapis.com/maps/api/place/textsearch/json?query=EC2M+7QH&key=[YOUR KEY]

Join the newsletter

Subscribe to get the latest content by email.

Powered by ConvertKit. If you give me your email address, you may receive emails from me (JJ) about posts on this site. You can unsubscribe at any time.

Porchy Ltd is a company registered in England, no. 12035925

VAT Registration no. 331196421

Built with WPGraphQL and Gatsby

© 2019 - 2021