The Google Maps photos API for every photo of a place
Send one place identifier and page through its photos. Each photo returns an image URL and its size. Pass a place_id and read the photos below.
Google Maps Photos API at a glance
This API returns photos for one Google Maps place. Send a POST request with one identifier. Read the photos array in the response. Run the example below to see the exact shape.
- Endpoint
POST /v1/data/google/maps/photos- Authentication
- API key as
Authorization: Bearer wh_… - Stage
- Stable
- Output
- A photos array plus a place summary, a categories list, has_more and next_page_token
- Photo fields
- photo_id, category_id, thumbnail, image, width and height
- Lookup keys
- Send one of data_id, place_id or cid
- Results per request
- 1 to 20 photos per page. The default is 20.
- Credit weight
- 1. See the pricing page for current rates.
One request, structured JSON.
This request fetches two photos of one coffee shop. The response below is trimmed to one photo. Copy the request to try it yourself.
curl -X POST "https://api.datablue.dev/v1/data/google/maps/photos" \
-H "Authorization: Bearer wh_..." \
-H "Content-Type: application/json" \
-d '{
"place_id": "ChIJfbedxbZZwokRpbnR5BBdz1c",
"num_results": 2
}'{
"success": true,
"time_taken": 7.925,
"place": {
"title": "787 coffee",
"address": "245 W 46th St, New York, NY 10036, United States",
"rating": 4.9,
"total_reviews": 3791
},
"categories": [],
"photos": [
{
"photo_id": "CIHM0ogKEICAgID9o8zwNw",
"category_id": "CgIgAQ==",
"thumbnail": "https://lh3.googleusercontent.com/gps-cs-s/ANWiy9RmfS8wE96-5GJ_0qpSzM3eFG5ETJKeQs911So2xnaMCacknFw5OtNgWpAPDu4SSP-8JoRUmQ5ZZKA8I_-TuwOEeZjFIVeU01t3kRx-2vriAY2LQ2zrThKMcI2Jj7_A5Oxt-F0G=w203-h270-k-no",
"image": "https://lh3.googleusercontent.com/gps-cs-s/ANWiy9RmfS8wE96-5GJ_0qpSzM3eFG5ETJKeQs911So2xnaMCacknFw5OtNgWpAPDu4SSP-8JoRUmQ5ZZKA8I_-TuwOEeZjFIVeU01t3kRx-2vriAY2LQ2zrThKMcI2Jj7_A5Oxt-F0G=w1200-h900-k-no",
"width": 1200,
"height": 1600
}
],
"has_more": true
}What a photo returns.
Each photo arrives as one object with named fields.
Image URLs
Each photo has a large image URL and a smaller thumbnail URL, so previews load first. Use the thumbnail in grids and the image on click.
Size
Each photo reports a width and a height. The sample shows a portrait photo at 1200 by 1600. Read both values to reserve layout space before images load.
Identifiers
Each photo has a photo_id and a category_id, so store photo_id to avoid saving the same image twice.
Categories
The response carries a categories list for the place. That list was empty for the sample place. Pass a category_id to return photos from one category only.
Missing fields
The two sample photos carry no caption or author field. Check each photo object for the keys you need.
Place summary
Each response names the place with its address and rating. Check the place object to confirm the right business.
Options that shape your photo list.
Only a place identifier is required to list photos, so add the other options when you want to filter and page results.
Identifier
Send exactly one of data_id, place_id or cid. A place_id looks like ChIJ9fZczEkVrjsR_E8O1PogkTs while a data_id has two hex halves joined by a colon.
Page size
Set num_results from 1 to 20 photos per page. The default is 20 photos per page.
Paging
Each response includes next_page_token and a has_more flag, so send the token back to fetch the next page. Stop paging once has_more comes back false.
Category filter
Set category_id to one value from the categories list. The list was empty for the sample place, so check it before you pass a filter.
Language and country
Set language to choose the language of result text. Set country to a two letter code for a market.
What teams build with it.
Photo lists suit listing audits and visual research.
Gallery previews
Show the thumbnail in a grid on your listing page, then link each tile to the large image.
Listing audits
Page through each branch and count its photos, then flag the branches that show too few.
Moderation queues
Download the image URLs into your own review queue, then check each photo against your brand standards.
Visual datasets
Collect photos of one place type across a city, and keep the photo_id so you never store duplicates. Check usage rights before you train on any image.
Why call an API instead of scraping photo galleries yourself.
Google Maps Place reported 2197 photos for the sample place. A set that size has to be fetched page by page, and each page needs its own request. This API turns each page into a single call.
DataBlue returns each photo as a parsed JSON object. Your code reads the image URL and the size. You never parse a gallery page by hand.
Google Maps Place returns a photo_count and one thumbnail URL. This API returns the photos themselves with sizes and paging. Use Place for counts and this API for images. Run a search, then pass one place_id here.
Your first photos request in a minute.
Sign up, grab a key and run one request.
Create an account
Sign up to get your API key.
Find an identifier
Run a Maps search and copy any place_id. Use a data_id or a cid if you hold one.
Send the request
Send a POST request to /v1/data/google/maps/photos with your key. Add num_results to set the size of each page. Then read the photos array in the response.
Google Maps photos API questions.
Short answers about image URLs and billing before you start.
It returns photos for one Google Maps place as JSON. Each photo is one object with URLs and a size.
Still have a question?Ask us anything
Set num_results from 1 to 20 photos per page. Use next_page_token to fetch the following pages.
Google Maps Place returns a photo_count and one thumbnail URL. This API lists the photos themselves page by page.
Each photo includes a width and a height. Use them to reserve space in your layout.
The two sample photos carry no caption or author field. Run a live request to confirm the fields you need.
Set category_id to one value from the categories list. The list was empty for the sample place, so check it before you pass a filter.
Send one of data_id, place_id or cid. Google Maps search returns the place IDs to use here.
Keep paging with next_page_token until has_more is false, or stop once you reach the count you need.
It does the scraping for you and returns JSON, so your code sends one request and reads the photos array.
This API is marked stable in the catalogue today. Build against the documented fields and read the changelog before you upgrade your integration in production.
This API has a credit weight of 1. Check the pricing page for current rates.
List Google Maps photos in a minute.
Create an account to get your key. Then paste the example request into your terminal.
Start free
