YepAPI
Google Maps API

Place Photos

Resolve a Google Maps photo reference into a real, fetchable image URL — sized up to 4800px, sourced live from the official Google Place Photos endpoint.

POST/v1/maps/photo
$0.01/call

Turn a photo reference into an image. Every result from Maps Search and Place Details includes a photos array with up to ten entries — each carries a reference like places/{place_id}/photos/{token}. Pass one here and get back a direct googleusercontent.com image URL at the size you ask for.

Info

The resolved image URLs are served by Google for a limited time — fetch the image promptly and store a copy if you need it long-term, rather than hot-linking the URL. Resolutions are cached on our side for up to an hour, so treat photoUri as fetch-now; re-resolving after the cache window returns a fresh URL.

Usage

const res = await fetch('https://api.yepapi.com/v1/maps/photo', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    reference: 'places/ChIJBR3G8LJqkFQRWD2Wzn0qG3c/photos/AU_ZVEFd3Y9YtVSYWUZf4lY...',
    max_width: 1200,
  }),
});
const { data } = await res.json();
console.log(data.photoUri); // https://lh3.googleusercontent.com/p/...
curl -X POST https://api.yepapi.com/v1/maps/photo \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reference": "places/ChIJBR3G8LJqkFQRWD2Wzn0qG3c/photos/AU_ZVEFd3Y9YtVSYWUZf4lY...", "max_width": 1200}'

Request Body

ParameterTypeRequiredDescriptionDefault
referencestringYesPhoto resource name from photos[].reference: places/{place_id}/photos/{token}. The places/ prefix is optional.
max_widthnumberNoMax width of the returned image in px, 14800. Google scales down to fit, preserving aspect ratio; it never upscales.1200 if neither dimension is set
max_heightnumberNoMax height of the returned image in px, 14800. Combine with max_width to bound both axes.

Response

{
  "ok": true,
  "data": {
    "reference": "places/ChIJBR3G8LJqkFQRWD2Wzn0qG3c/photos/AU_ZVEFd3Y9YtVSYWUZf4lY...",
    "photoUri": "https://lh3.googleusercontent.com/p/AF1QipM...=s1600-w1200"
  }
}
FieldTypeDescription
data.referencestringThe resolved photo resource name (normalised form).
data.photoUristringDirectly fetchable image URL. Valid for a limited time — download promptly.

Getting a reference

Photo references come from the other Maps endpoints — you never construct one by hand:

// photos[] on /v1/maps/search and /v1/maps/place results
{
  "reference": "places/ChIJBR3G8LJqkFQRWD2Wzn0qG3c/photos/AU_ZVEFd3Y9YtVSYWUZf4lY...",
  "width": 4032,
  "height": 3024,
  "attribution": "Storyville Coffee Company"
}

The width/height on the reference are the original upload's dimensions — useful for picking which photos are worth resolving at large sizes.

References themselves can change over time as Google refreshes a place's photo set — don't store them for months. If a stored reference stops resolving, re-fetch the place with Maps Search or Place Details to get current references.

Pricing

$0.01 per call. No monthly minimums.

Under the Hood

Sourced live from the official Google Place Photos endpoint (Places API New) — the same user- and owner-uploaded photos Google Maps displays. Attribution requirements for displaying Google place photos apply to your end use.

On this page