pkcrawford
pkcrawford

Reputation: 21

Incorrect Place_ID Details in Google Maps API

How do I go about getting the Google Maps API Place ID details corrected?

As an example, for the place_id = ChIJq-W618k0K4gRRJXspdvJ9ck, I get the following Google Places API Web Service response:

"formatted_address" : "Toronto General Hospital, 200 Elizabeth Street, Toronto, ON M5G 2C4, Canada"

but it really should be returning:

"formatted_address" : "200 Elizabeth Street, Toronto, ON M5G 2C4, Canada"

The name of the building should not be included with the formatted address.

Upvotes: 0

Views: 1083

Answers (1)

miguev
miguev

Reputation: 4865

Looks like you got that formatted address from the Geocoding API. This API does not have a "name" field in the response, so the name of the hospital has nowhere to go but into the "formatted_address" field:

https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJq-W618k0K4gRRJXspdvJ9ck&key=YOUR_API_KEY

formatted_address: "Toronto General Hospital, 200 Elizabeth Street, Toronto, ON M5G 2C4, Canada",

If you'd like to have the name and address in separate fields, send a Places API Details request:

https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJq-W618k0K4gRRJXspdvJ9ck&key=YOUR_API_KEY

formatted_address: "200 Elizabeth Street, Toronto, ON M5G 2C4, Canada",
name: "Toronto General Hospital",

You will get the name in the formatted address, even in Places API, if the Place ID represents a building (types: ["premise"]):

https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJq-W618k0K4gRRJXspdvJ9ck&key=YOUR_API_KEY

formatted_address: "Hyman Soloway, 157 Laurier Ave E, Ottawa, ON K1N 1K5, Canada"
name: "Hyman Soloway"

If you find this is the case with a building that doesn't have a name, but the name actually is that of a business in that building, here's how to report this problem in Google Maps:

  1. Find the places in Google Maps (Hyman Soloway)
  2. Click on Add a missing place
  3. Move the name of the business from the Address field to Name
  4. Fill in the rest of fields to the best of your knowledge and Submit

Upvotes: 1

Related Questions