Method: places.photos.getMedia

Get a photo media with a photo reference string.

HTTP request

GET https://places.googleapis.com/v1/{name=places/*/photos/*/media}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The resource name of a photo media in the format: places/{placeId}/photos/{photo_reference}/media.

The resource name of a photo as returned in a Place object's photos.name field comes with the format places/{placeId}/photos/{photo_reference}. You need to append /media at the end of the photo resource to get the photo media resource name.

Query parameters

Parameters
maxWidthPx

integer

Optional. Specifies the maximum desired width, in pixels, of the image. If the image is smaller than the values specified, the original image will be returned. If the image is larger in either dimension, it will be scaled to match the smaller of the two dimensions, restricted to its original aspect ratio. Both the maxHeightPx and maxWidthPx properties accept an integer between 1 and 4800, inclusively. If the value is not within the allowed range, an INVALID_ARGUMENT error will be returned.

At least one of maxHeightPx or maxWidthPx needs to be specified. If neither maxHeightPx nor maxWidthPx is specified, an INVALID_ARGUMENT error will be returned.

maxHeightPx

integer

Optional. Specifies the maximum desired height, in pixels, of the image. If the image is smaller than the values specified, the original image will be returned. If the image is larger in either dimension, it will be scaled to match the smaller of the two dimensions, restricted to its original aspect ratio. Both the maxHeightPx and maxWidthPx properties accept an integer between 1 and 4800, inclusively. If the value is not within the allowed range, an INVALID_ARGUMENT error will be returned.

At least one of maxHeightPx or maxWidthPx needs to be specified. If neither maxHeightPx nor maxWidthPx is specified, an INVALID_ARGUMENT error will be returned.

skipHttpRedirect

boolean

Optional. If set, skip the default HTTP redirect behavior and render a text format (for example, in JSON format for HTTP use case) response. If not set, an HTTP redirect will be issued to redirect the call to the image media. This option is ignored for non-HTTP requests.

Request body

The request body must be empty.

Response body

A photo media from Places API.

If successful, the response body contains data with the following structure:

JSON representation
{
  "name": string,
  "photoUri": string
}
Fields
name

string

The resource name of a photo media in the format: places/{placeId}/photos/{photo_reference}/media.

photoUri

string

A short-lived uri that can be used to render the photo.