Select platform: [Android](https://developers.google.com/maps/documentation/places/android-sdk/place-photos.md.txt "View this page for the Android platform docs.") [iOS](https://developers.google.com/maps/documentation/places/ios-sdk/place-photos.md.txt "View this page for the iOS platform docs.") [Web Service](https://developers.google.com/maps/documentation/places/web-service/place-photos.md.txt "View this page for the Web Service platform docs.")

<br />

**European Economic Area (EEA) developers**

> [!NOTE]
> If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](https://developers.google.com/maps/comms/eea/faq.md.txt).

Place Photos (New) lets you add high quality photographic content to your
application. Place Photos gives you access to the millions of photos stored in
the Places database. Place Photos returns a URI to a bitmap image. The bitmap
image has a maximum size of 4800 by 4800 pixels.

> [!NOTE]
> **Note:** Place Photos (New) is available in Places SDK for Android version 3.4.0 and later. For more information, see [Choose your SDK
> version](https://developers.google.com/maps/documentation/places/android-sdk/choose-sdk). For more information about using the Kotlin APIs added in version 4.0.0, see the [Reference
> Overview](https://developers.google.com/maps/documentation/places/android-sdk/reference).

## Place Photos requests

To retrieve an image for a place:

1. Use [Place Details (New)](https://developers.google.com/maps/documentation/places/android-sdk/details-places) to fetch a `Place` object using [`fetchPlace()`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesClient.md.txt#fetchPlace(com.google.android.libraries.places.api.net.FetchPlaceRequest)). Be sure to include the `Place.Field PHOTO_METADATAS` field in the list of fields to include in the response `Place` object.
2. In the [`OnSuccessListener`](https://developer.android.com/reference/com/google/android/play/core/tasks/OnSuccessListener) for your [`FetchPlaceResponse`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/net/FetchPlaceResponse.md.txt), call [`Place.getPhotoMetadas()`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/Place.md.txt#getPhotoMetadatas()) to get the photo metadata object of type [`PhotoMetadata`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/PhotoMetadata.md.txt) from the response `Place` object.
3. Create a [`FetchResolvedPhotoUriRequest`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/net/FetchResolvedPhotoUriRequest.Builder.md.txt) object to make the request and pass the photo metadata object, as well values for maximum height, maximum width, or both.
4. Use [`PlacesClient.fetchResolvedPhotoUri()`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesClient.md.txt#fetchResolvedPhotoUri(com.google.android.libraries.places.api.net.FetchResolvedPhotoUriRequest)) to request the photo URI.
5. Add an `OnSuccessListener` and get the photo URI from the [`FetchResolvedPhotoUriResponse`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/net/FetchResolvedPhotoUriResponse.md.txt) object.

> [!NOTE]
> **Note:** For more information on initializing `PlacesClient`, see [Initialize the Places API client](https://developers.google.com/maps/documentation/places/android-sdk/config.md.txt#connect-client).

> [!NOTE]
> You can use a [CancellationToken](https://developers.google.com/android/reference/com/google/android/gms/tasks/CancellationToken.md.txt)
> to attempt to cancel a request to any of the request classes (for example,
> `FetchPlaceRequest`). Cancellation is done on a best-effort basis.
> Once a cancellation request is issued, no response will be returned.
> **Issuing a cancellation token does NOT guarantee that a particular request
> will be cancelled, and you may still be charged for the request even if no
> response is returned**.

## Required parameters

The required parameters for
[`FetchResolvedPhotoUriRequest`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/net/FetchResolvedPhotoUriRequest.Builder.md.txt)
are:

-

  ### Photo metadata

  The metadata object of the photo to return.
-

  ### Maximum height or maximum width


  Specifies the maximum height and width, in pixels, of the image to return. 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 maximum height and maximum width properties accept an integer between 1 and 4800. You must specify maximum height, maximum width, or both.
  - To set the maximum height parameter, call the `setMaxHeight()` method when building the `FetchResolvedPhotoUriRequest` object.
  - To set the maximum width parameter, call the `setMaxWidth()` method when building the `FetchResolvedPhotoUriRequest` object.

## Place Photos examples

The following example demonstrates getting a place photo URI.

```java
// Define a Place ID.
final String placeId = "INSERT_PLACE_ID_HERE";

// Specify fields. Requests for photos must always have the PHOTO_METADATAS field.
final List<Place.Field> fields = Collections.singletonList(Place.Field.PHOTO_METADATAS);

// Get a Place object
final FetchPlaceRequest placeRequest = FetchPlaceRequest.newInstance(placeId, fields);

placesClient.fetchPlace(placeRequest).addOnSuccessListener((response) -> {
    final Place place = response.getPlace();

    // Get the photo metadata.
    final List<PhotoMetadata> metadata = place.getPhotoMetadatas();
    if (metadata == null || metadata.isEmpty()) {
        Log.w(TAG, "No photo metadata.");
        return;
    }
    final PhotoMetadata photoMetadata = metadata.get(0);

    // Get the attribution text and author attributions.
    final String attributions = photoMetadata.getAttributions();
    final AuthorAttributions authorAttributions = photoMetadata.getAuthorAttributions();

    // Create a FetchResolvedPhotoUriRequest.
    final FetchResolvedPhotoUriRequest photoRequest = FetchResolvedPhotoUriRequest.builder(photoMetadata)
        .setMaxWidth(500)
        .setMaxHeight(300)
        .build();

    // Request the photo URI
    placesClient.fetchResolvedPhotoUri(photoRequest).addOnSuccessListener((fetchResolvedPhotoUriResponse) -> {
        Uri uri = fetchResolvedPhotoUriResponse.getUri();
        RequestOptions requestOptions = new RequestOptions().override(Target.SIZE_ORIGINAL);
        Glide.with(this).load(uri).apply(requestOptions).into(imageView);
    }).addOnFailureListener((exception) -> {
        if (exception instanceof ApiException) {
            final ApiException apiException = (ApiException) exception;
            Log.e(TAG, "Place not found: " + exception.getMessage());
            final int statusCode = apiException.getStatusCode();
            // TODO: Handle error with given status code.
        }
    });
});
```

## Attributions

In most cases, place photos can be used without attribution, or will have
the required attribution included as part of the image. However, the photo metadata object, of type
[`PhotoMetadata`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/PhotoMetadata.md.txt),
can contain either of two types of additional attributions:

- **Attributions** , an attribution string accessed by [`PhotoMetadata.getAttributions()`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/PhotoMetadata.md.txt#public-abstract-string-getattributions).
- **AuthorAttributions** , an [`AuthorAttributions`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/AuthorAttributions.md.txt) object accessed by [`PhotoMetadata.getAuthorAttributions()`](https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/PhotoMetadata.md.txt#public-abstract-authorattributions-getauthorattributions).

If the returned `PhotoMetadata` object includes either type of attribution, you must
include the attribution in your application wherever you display the image. For more information,
see [Displaying Attributions](https://developers.google.com/maps/documentation/places/android-sdk/attributions#photos).