# SearchNearbyRequest

    struct SearchNearbyRequest

    extension SearchNearbyRequest : Equatable, Sendable, SendableMetatype

- `


  ### [==(_:_:)](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV2eeoiySbAC_ACtFZ)


  ` Returns a Boolean value indicating whether two values are equal.

  Equality is the inverse of inequality. For any values `a` and `b`,
  `a == b` implies that `a != b` is `false`.

  #### Declaration

  Swift

      static func == (a: SearchNearbyRequest, b: SearchNearbyRequest) -> Bool

- `


  ### [RankPreference](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest/RankPreference.html)


  ` How results will be ranked in the response.

  #### Declaration

  Swift

      enum RankPreference

      extension https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest.html.RankPreference : CaseIterable, Equatable, Hashable, Identifiable, Sendable, SendableMetatype

- `


  ### [excludedPrimaryTypes](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV20excludedPrimaryTypesShyAA9PlaceTypeVGSgvp)


  ` The set of primary place types to exclude from a search. If conflicting types are
  specified (e.g., types appearing in `https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest.html#/s:17GooglePlacesSwift19SearchNearbyRequestV13includedTypesShyAA9PlaceTypeVGSgvp` and `https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest.html#/s:17GooglePlacesSwift19SearchNearbyRequestV13excludedTypesShyAA9PlaceTypeVGSgvp`), an INVALID_REQUEST
  error is returned. Up to 50 types can be specified. If a request is specified with multiple
  type restrictions, only places that satisfy all of the restrictions are returned. For more
  information about primary types see:
  <https://developers.google.com/maps/documentation/places/web-service/nearby-search#includedtypesexcludedtypes,-includedprimarytypesexcludedprimarytypes>

  #### Declaration

  Swift

      var excludedPrimaryTypes: Set<https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceType.html>? { get }

- `


  ### [excludedTypes](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV13excludedTypesShyAA9PlaceTypeVGSgvp)


  ` The set of place types to exclude from a search. Up to 50 types can be specified. If a
  request is specified with multiple type restrictions, only places that satisfy all of the
  restrictions are returned. If conflicting types are specified (e.g., types appearing in
  `https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest.html#/s:17GooglePlacesSwift19SearchNearbyRequestV13includedTypesShyAA9PlaceTypeVGSgvp` and `excludedTypes`), an INVALID_REQUEST error is returned.

  See Table A for a list of supported types
  <https://developers.google.com/maps/documentation/places/web-service/place-types#table-a>. \*/

  #### Declaration

  Swift

      var excludedTypes: Set<https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceType.html>? { get }

- `


  ### [includedPrimaryTypes](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV20includedPrimaryTypesShyAA9PlaceTypeVGSgvp)


  ` The set of primary place types to include in a search. Up to 50 types can be specified. If
  a request is specified with multiple type restrictions, only places that satisfy all of the
  restrictions are returned. For more information about primary types see:
  <https://developers.google.com/maps/documentation/places/web-service/nearby-search#includedtypesexcludedtypes,-includedprimarytypesexcludedprimarytypes>

  #### Declaration

  Swift

      var includedPrimaryTypes: Set<https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceType.html>? { get }

- `


  ### [includedTypes](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV13includedTypesShyAA9PlaceTypeVGSgvp)


  ` The set of place types to include in a search. Up to 50 types can be specified. If a
  request is specified with multiple type restrictions, only places that satisfy all of the
  restrictions are returned. If the set is empty, then all places of all types are returned.

  See Table A for a list of supported types
  <https://developers.google.com/maps/documentation/places/web-service/place-types#table-a>. \*/

  #### Declaration

  Swift

      var includedTypes: Set<https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceType.html>? { get }

- `


  ### [init(locationRestriction:placeProperties:includedTypes:excludedTypes:includedPrimaryTypes:excludedPrimaryTypes:maxResultCount:rankPreference:regionCode:routingParameters:shouldIncludeRoutingSummaries:)](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV19locationRestriction15placeProperties13includedTypes08excludedL00k7PrimaryL00mnL014maxResultCount14rankPreference10regionCode17routingParameters29shouldIncludeRoutingSummariesAcA016CoordinateRegionH0_p_SayAA13PlacePropertyOGShyAA9PlaceTypeVGSgA3VSiAC04RankS0OSSSgAA0zW0VSgSbtcfc)


  ` Instantiates a `SearchNearbyRequest` with a text query and place properties to return.

  #### Declaration

  Swift

      init(locationRestriction: any https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Protocols/CoordinateRegionRestriction.html, placeProperties: [https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Enums/PlaceProperty.html], includedTypes: Set<https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceType.html>? = nil, excludedTypes: Set<https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceType.html>? = nil, includedPrimaryTypes: Set<https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceType.html>? = nil, excludedPrimaryTypes: Set<https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceType.html>? = nil, maxResultCount: Int = 20, rankPreference: SearchNearbyRequest.https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest/RankPreference.html = .popularity, regionCode: String? = nil, routingParameters: https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/RoutingParameters.html? = nil, shouldIncludeRoutingSummaries: Bool = false)

  #### Parameters

  |---|---|
  | ` locationRestriction ` | The restricted region to search. |
  | ` placeProperties ` | The `placeProperty`s that should be included in place results. Must not be empty. An empty list will result in an error when trying to send the request. |
  | ` includedTypes ` | The set of place types to include in a search. |
  | ` excludedTypes ` | The set of place types to exclude from a search. |
  | ` includedPrimaryTypes ` | The set of primary place types to include in a search. |
  | ` excludedPrimaryTypes ` | The set of primary place types to exclude from a search |
  | ` maxResultCount ` | The maximum number of results to return. Must be between 1 and 20 (default), inclusive. |
  | ` rankPreference ` | The `https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest/RankPreference.html` to sort the results. Defaults to `.popularity`. |
  | ` regionCode ` | The unicode country/region code (CLDR) of the request location. |
  | ` routingParameters ` | The routing parameters to use for the search. |
  | ` shouldIncludeRoutingSummaries ` | Whether to include routing summaries in the response. Defaults to false. Setting `https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest.html#/s:17GooglePlacesSwift19SearchNearbyRequestV29shouldIncludeRoutingSummariesSbvp` to `true` without also including the `routingParameters.origin` parameter in the request causes an error. |

- `


  ### [locationRestriction](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV19locationRestrictionAA016CoordinateRegionH0_pvp)


  ` The region to search specified as a circle, defined by center point and radius in meters.
  The radius must be between 0.0 and 50000.0, inclusive. The `locationRestriction` must be
  specified with `https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/CircularCoordinateRegion.html`. Using `https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/RectangularCoordinateRegion.html` will result
  in an error.

  #### Declaration

  Swift

      var locationRestriction: any https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Protocols/CoordinateRegionRestriction.html { get }

- `


  ### [maxResultCount](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV14maxResultCountSivp)


  ` The maximum number of `https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/Place.html` results to return. Must be between 1 and 20 (default)
  inclusive. Breaking this restriction will result in an error returned.

  #### Declaration

  Swift

      var maxResultCount: Int { get }

- `


  ### [placeProperties](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV15placePropertiesSayAA13PlacePropertyOGvp)


  ` The array of `https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Enums/PlaceProperty.html` that should be included in place results.

  #### Declaration

  Swift

      var placeProperties: [https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Enums/PlaceProperty.html] { get }

- `


  ### [rankPreference](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV14rankPreferenceAC04RankH0Ovp)


  ` The `https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest/RankPreference.html` used to sort the results returned from the request.
  The default value is `.distance.` \*/

  #### Declaration

  Swift

      var rankPreference: SearchNearbyRequest.https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest/RankPreference.html { get }

- `


  ### [regionCode](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV10regionCodeSSSgvp)


  ` The unicode country/region code (CLDR) of the location where the request is coming from.

  See <https://www.unicode.org/cldr/charts/44/supplemental/territory_language_information.html>
  for region codes.

  #### Declaration

  Swift

      var regionCode: String? { get }

- `


  ### [routingParameters](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV17routingParametersAA07RoutingH0VSgvp)


  ` The routing parameters to use for the search.

  #### Declaration

  Swift

      var routingParameters: https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/RoutingParameters.html? { get }

- `


  ### [shouldIncludeRoutingSummaries](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/SearchNearbyRequest#/s:17GooglePlacesSwift19SearchNearbyRequestV29shouldIncludeRoutingSummariesSbvp)


  ` Whether to include routing summaries in the response. Defaults to false.

  #### Declaration

  Swift

      var shouldIncludeRoutingSummaries: Bool { get }