Place Details

Stay organized with collections Save and categorize content based on your preferences.
Select platform: Android iOS JavaScript Web Service

The Places SDK for iOS provides your app with rich information about places, including the place's name and address, the geographical location specified as latitude/longitude coordinates, the type of place (such as night club, pet store, museum), and more. To access this information for a specific place, you can use the place ID, a stable identifier that uniquely identifies a place.

Place details

The GMSPlace class provides information about a specific place. You can get hold of a GMSPlace object in the following ways:

Place fields

When you request a place, you must specify which types of place data to return. To do this, pass a GMSPlaceField, specifying the data types to return. This is an important consideration, since this will affect the cost for each request. Because place data results cannot be empty, only place results with data are returned (for example, if a requested place has no photos, the photos field will not be present in the result). You can specify one or more of the following fields:

  • GMSPlaceFieldName
  • GMSPlaceFieldPlaceID
  • GMSPlaceFieldPlusCode
  • GMSPlaceFieldBusinessStatus
  • GMSPlaceFieldCoordinate
  • GMSPlaceFieldOpeningHours
  • GMSPlaceFieldPhoneNumber
  • GMSPlaceFieldFormattedAddress
  • GMSPlaceFieldRating
  • GMSPlaceFieldPriceLevel
  • GMSPlaceFieldTypes
  • GMSPlaceFieldWebsite
  • GMSPlaceFieldViewport
  • GMSPlaceFieldAddressComponents
  • GMSPlaceFieldPhotos
  • GMSPlaceFieldUserRatingsTotal
  • GMSPlaceFieldIconImageURL
  • GMSPlaceFieldIconBackgroundColor
  • GMSPlaceFieldUTCOffsetMinutes
  • GMSPlaceFieldAll

Learn more about place fields. For more information about how Place data requests are billed, see Usage and Billing.

The GMSPlace class can contain the following place data:

  • name – The place's name.
  • placeID – The textual identifier for the place. Read more about place IDs in the rest of this page.
  • coordinate – The geographical location of the place, specified as latitude and longitude coordinates.
  • businessStatus – The operational status of the place, if it is a business. It can contain one of the following values: GMSBusinessStatusOperational, GMSBusinessStatusClosedTemporarily, GMSBusinessStatusClosedPermanently, GMSBusinessStatusUnknown.
  • phoneNumber – The place's phone number, in international format.
  • formattedAddress – The human-readable address of this location.

    Often this address is equivalent to the postal address. Note that some countries, such as the United Kingdom, do not allow distribution of true postal addresses due to licensing restrictions.

    The formatted address is logically composed of one or more address components. For example, the address "111 8th Avenue, New York, NY" consists of the following components: "111" (the street number), "8th Avenue" (the route), "New York" (the city) and "NY" (the US state).

    Do not parse the formatted address programmatically. Instead you should use the individual address components, which the API response includes in addition to the formatted address field.

  • rating – An aggregated rating of the place, returned as a float with values ranging from 1.0 to 5.0, based on aggregated user reviews.
  • openingHours – The opening hours for the place (as represented by GMSOpeningHours). Call GMSOpeningHours.weekdayText to get a list of localized strings of the daily opening hours for the week. Call GMSOpeningHours.Periods to return a list of GMSPeriods with more detailed information that is equivalent to the data provided by weekdayText. Note: If a place is always open, the time period is represented as Sunday at midnight, and the closeEvent is null.
  • plusCode – The Plus code representation of the location for the place.
  • priceLevel – The price level for this place, returned as an integer with values ranging from 0 (cheapest) to 4 (most expensive).
  • types – A list of place types that characterize this place. This array may contain multiple values, or may be empty. New values may be introduced without prior notice. See the list of supported types.
  • website – The URI of the place's website, if known. This is the website maintained by the business or other entity associated with the place.
  • attributions – An NSAttributedString containing the attributions that you must display to the user if your app uses place details retrieved from the Places SDK for iOS. For details on retrieving and displaying attributions, see the attributions guide.
  • addressComponents – An array of GMSAddressComponent objects representing components of the address for a place. These components are provided for the purpose of extracting structured information about a place's address, for example finding the city in which a place is located. Do not use these components for address formatting; instead, use the formattedAddress property, which provides a localized formatted address.

    Note the following facts about the addressComponents array:

    • The array of address components may contain more components than the formattedAddress.
    • The array does not necessarily include all the political entities that contain an address, apart from those included in the formattedAddress.
    • The format of the response is not guaranteed to remain the same between requests. In particular, the number of addressComponents varies based on the address requested and can change over time for the same address. A component can change position in the array. The type of the component can change. A particular component may be missing in a later response.
  • userRatingsTotal – Represents how many reviews make up the place's rating.
  • GMSPlaceFieldIconImageURL – The URL for an icon representing the place type (PNG format).
  • GMSPlaceFieldIconBackgroundColor – The background color for the place type icon.
  • UTCOffsetMinutes – The timezone offset of the place, in minutes.

The GMSPlace class contains the following member functions:

  • isOpen calculates whether a place is open at the given time, based on openingHours and UTCOffsetMinutes, and the current date and time.
  • isOpenAtDate calculates whether a place is open on a given date, based on openingHours and UTCOffsetMinutes, and the current date and time.
  • When using these functions to get opening times and/or dates, the original fetchPlaceFromPlaceID: or findPlaceLikelihoodsFromUserLocationWithPlaceFields: request must specify BOTH GMSPlaceFieldOpeningHours and GMSPlaceFieldUTCOffsetMinutes fields. If either of these fields is missing, the resulting GMSPlace object will not contain opening times or dates, and the call will return GMSPlaceOpenStatusUnknown. To ensure accurate results, request the GMSPlaceFieldBusinessStatus and GMSPlaceFieldUTCOffsetMinutes fields in your original place request. If not requested, it is assumed that the business is operational.

    See this video for how to use isOpen with Place Details.

Get a place by ID

A place ID is a textual identifier that uniquely identifies a place. In the Places SDK for iOS, you can retrieve the ID of a place from a GMSPlace object. You can store the place ID and use it to retrieve the GMSPlace object again later.

To get a place by ID, call GMSPlacesClient fetchPlaceFromPlaceID:, passing the following parameters:

  • A string containing a Place ID.
  • One or more GMSPlaceFields, specifying the data types to return.
  • A session token if the call is made to conclude an autocomplete query. Otherwise, pass nil.
  • A GMSPlaceResultCallback to handle the result.

The API invokes the specified callback method, passing in a GMSPlace object. If the place is not found, the place object is nil.


// A hotel in Saigon with an attribution.
let placeID = "ChIJV4k8_9UodTERU5KXbkYpSYs"

// Specify the place data types to return.
let fields: GMSPlaceField = GMSPlaceField(rawValue: UInt( |

placesClient?.fetchPlace(fromPlaceID: placeId, placeFields: fields, sessionToken: nil, callback: {
  (place: GMSPlace?, error: Error?) in
  if let error = error {
    print("An error occurred: \(error.localizedDescription)")
  if let place = place {
    self.lblName?.text =
    print("The selected place is: \(")


// A hotel in Saigon with an attribution.
NSString *placeId = @"ChIJV4k8_9UodTERU5KXbkYpSYs";

// Specify the place data types to return.
GMSPlaceField fields = (GMSPlaceFieldName | GMSPlaceFieldPlaceID);

[_placesClient fetchPlaceFromPlaceID:placeId placeFields:fields sessionToken:nil callback:^(GMSPlace * _Nullable place, NSError * _Nullable error) {
  if (error != nil) {
    NSLog(@"An error occurred %@", [error localizedDescription]);
  if (place != nil) {
    NSLog(@"The selected place is: %@", [place name]);

Display attributions in your app

When your app displays information obtained from GMSPlacesClient lookUpPlaceID:callback:, the app must also display attributions. See the documentation on attributions.

More about place IDs

The place ID used in the Places SDK for iOS is the same identifier as used in the Places API, Places SDK for Android and other Google APIs.

Each place ID can refer to only one place, but a single place can have more than one place ID.

There are circumstances which may cause a place to get a new place ID. For example, this may happen if a business moves to a new location.

When you request a place by specifying a place ID, you can be confident that you will always receive the same place in the response (if the place still exists). Note, however, that the response may contain a place ID that is different from the one in your request.

For more information, see the place ID overview.