You can use Place Photos API. The Place Photo service, part of the Places API, is a read- only API that allows you to add high quality photographic content to your application. This gives you access to the millions of photos stored in the Places database.
To use, you just have to send Place Photo request is an HTTP URL of the following form:
https://maps.googleapis.com/maps/api/place/photo?parameters
An example of it is:
https://maps.googleapis.com/maps/api/place/photo
?maxwidth=400
&photo_reference=Aap_uEA7vb0DDYVJWEaX3O-AtYp77AaswQKSGtDaimt3gt7QCNpdjp1BkdM6acJ96xTec3tsV_ZJNL_JP-lqsVxydG3nh739RE_hepOOL05tfJh2_ranjMadb3VoBYFvF0ma6S24qZ6QJUuV6sSRrhCskSBP5C1myCzsebztMfGvm7ij3gZT
&key=YOUR_API_KEY
As you can see, there is a photo_reference
parameter. This can be found in the response to a Find Place API, Nearby Search API, Text Search API, or Place Details API web request.
Here is an example of Place Details API web request to get the photo reference of the address 48 Pirrama Rd, Pyrmont NSW 2009, Australia
:
https://maps.googleapis.com/maps/api/place/details/json
?fields=photo
&place_id=ChIJN1t_tDeuEmsRUsoyG83frY4
&key=YOUR_API_KEY
I use the photo
in the fields
parameter to get the address’ photo reference: link
As you can see from the Place Details API response, there are multiple photo references for this address.
To get the photo, we’ll just use a photo reference from the Place Details API response, and put it in the photo_reference
parameter of the Place Photo API request. Here’s an example:
https://maps.googleapis.com/maps/api/place/photo
?maxwidth=400
&photo_reference=Aap_uEBzMi8oa8zOmZQoAFNNGq1E6wS4GuzFJu-zrNlnB254m8yrHhp9SpE-6U90PaqyLESwpX3avM1wVRKp9enfT_Yo6fl_2GR50nWd_CEJLuBOMZtomgXVdQfL8-7K4rO3hiagtQI44cr4KvQuv-sN9N3FOnIvMqD4W5IZtPgCh1oEZyQI
&key=YOUR_API_KEY
2
solved Make posts(images) to google map Business location by API [closed]