API 文档提供英文版本。

Google Maps Photos

List a place's photos and videos, including only the ones its owner posted.

GET/api/v1/google/maps/photos

Costs 1 credit per request; failed requests are refunded. Authentication, the search_metadata envelope and error codes are the same as for every endpoint (see the API reference). Try it in the playground.

Parameters

Place photos

Choose the place and which of its photo categories to list, 20 photos and videos per page.

ParameterTypeDescription
data_idconditionalstringHexadecimal Google Maps feature ID of the place.Up to 40 characters.Use the data_id of a /api/google/maps result.Exactly one of data_id or place_id is required.
place_idconditionalstringGoogle business Place ID of the place.Up to 512 characters.Use a business Place ID (ChIJ…), such as the place_id of a /api/google/maps result.Exactly one of place_id or data_id is required.
category"all" | "latest" | "by_owner" | "videos" | "street_view" | "menu" | "food_and_drink" | "vibe"Which of the place's photo categories to list.Default: all.by_owner lists only the photos and videos the business posted itself.menu, food_and_drink and vibe are the categories Google shows for restaurants and bars.A category the place has no photos in returns HTTP 404 not_found and is not billed.

Pagination

Continue a photo list with the token from the previous page.

ParameterTypeDescription
next_page_tokenstringOpaque continuation token from pagination.next_page_token.Up to 8,192 characters.Pass the token back unchanged with the same data_id or place_id.The next page keeps the category of the page the token came from.

Localization

Control the Google language and country.

ParameterTypeDescription
hlstringLanguage used for Google labels.Default: en.Up to 32 characters.Examples: en, es, fr, de
glstringTwo-letter country code used for regional localization.Default: us.Examples: us, gb, de, jp

Response

A JSON object with search_metadata (request id, credits used and remaining) and the result groups the page returns. Groups and fields depend on the content of each page, so treat every field as optional.

Examples

cURL
curl "https://serpfast.com/api/v1/google/maps/photos?data_id=0x89c259a5d30bfd3d%3A0x88ed7e15edfea20f&category=by_owner" \
  -H "Authorization: Bearer $SERPFAST_KEY"
Node.js 18+
const params = new URLSearchParams({
  "data_id": "0x89c259a5d30bfd3d:0x88ed7e15edfea20f",
  "category": "by_owner"
});
const res = await fetch(`https://serpfast.com/api/v1/google/maps/photos?${params}`, {
  headers: { Authorization: `Bearer ${process.env.SERPFAST_KEY}` },
});
const data = await res.json();
console.log(data);
Python
import os, requests

params = {
  "data_id": "0x89c259a5d30bfd3d:0x88ed7e15edfea20f",
  "category": "by_owner"
}
res = requests.get(
    "https://serpfast.com/api/v1/google/maps/photos",
    params=params,
    headers={"Authorization": f"Bearer {os.environ['SERPFAST_KEY']}"},
    timeout=120,
)
print(res.json())