GooglePlaces Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSPlaceSearchNearbyRequest
@interface GMSPlaceSearchNearbyRequest : NSObject
Request object to use with GMSPlacesClient
to fetch nearby places.
-
Instantiates a GMSPlaceSearchNearbyRequest
with a location restriction and place properties to
return.
Declaration
Objective-C
- (nonnull instancetype)
initWithLocationRestriction:
(nonnull id<GMSPlaceLocationRestriction>)locationRestriction
placeProperties:(nonnull NSArray<NSString *> *)placeProperties;
Parameters
locationRestriction
|
The region to search specified as a circle, defined by center point
and radius in meters.
|
placeProperties
|
The array of GMSPlaceProperty 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.
|
-
Default init is not available. Please use the designated initializer.
Declaration
Objective-C
- (nonnull instancetype)init;
-
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. Breaking this restriction will result in an
INVALID_ARGUMENT error. The locationRestriction must be specified with
GMSPlaceCircularLocationOption
. Using GMSPlaceRectangularLocationOption
will result in an
INVALID_REQUEST error.
-
The array of GMSPlaceProperty
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.
Declaration
Swift
var placeProperties: [String] { get set }
Objective-C
@property (nonatomic, copy) NSArray<NSString *> *_Nonnull placeProperties;
-
Declaration
Swift
var includedTypes: [String]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *includedTypes;
-
The array 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 includedTypes 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: [String]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *excludedTypes;
-
Declaration
Swift
var includedPrimaryTypes: [String]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *includedPrimaryTypes;
-
Declaration
Swift
var excludedPrimaryTypes: [String]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *excludedPrimaryTypes;
-
The maximum number of GMSPlace
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 set }
Objective-C
@property (nonatomic) NSInteger maxResultCount;
-
Declaration
Swift
var regionCode: String? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSString *regionCode;
-
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSPlaceSearchNearbyRequest\u003c/code\u003e objects are used with \u003ccode\u003eGMSPlacesClient\u003c/code\u003e to fetch nearby places based on specified criteria.\u003c/p\u003e\n"],["\u003cp\u003eRequests require a circular location restriction defining the search area and an array of desired place properties.\u003c/p\u003e\n"],["\u003cp\u003eYou can further refine searches by including or excluding specific place types, setting a maximum result count, and specifying a region code.\u003c/p\u003e\n"],["\u003cp\u003eResults can be sorted by prominence or distance using the \u003ccode\u003erankPreference\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eThe default maximum number of results returned is 20, and the default ranking is based on place popularity.\u003c/p\u003e\n"]]],["`GMSPlaceSearchNearbyRequest` fetches nearby places using a location restriction and specified properties. It requires a location restriction (circle with center/radius) and an array of `GMSPlaceProperty`. You can include or exclude specific place types and primary types (up to 50 each). Set a maximum result count (1-20), a region code, and a ranking preference. Default initialization is unavailable; use `initWithLocationRestriction:placeProperties:`.\n"],null,["# GooglePlaces Framework Reference\n\nGMSPlaceSearchNearbyRequest\n===========================\n\n @interface GMSPlaceSearchNearbyRequest : NSObject\n\nRequest object to use with [GMSPlacesClient](../Classes/GMSPlacesClient.html) to fetch nearby places.\n- `\n ``\n ``\n `\n\n ### [-initWithLocationRestriction:placeProperties:](#/c:objc(cs)GMSPlaceSearchNearbyRequest(im)initWithLocationRestriction:placeProperties:)\n\n `\n ` \n Instantiates a `GMSPlaceSearchNearbyRequest` with a location restriction and place properties to\n return. \n\n #### Declaration\n\n Swift \n\n init(locationRestriction: any ../Protocols/GMSPlaceLocationRestriction.html, placeProperties: [String])\n\n Objective-C \n\n - (nonnull instancetype)\n initWithLocationRestriction:\n (nonnull id\u003c../Protocols/GMSPlaceLocationRestriction.html\u003e)locationRestriction\n placeProperties:(nonnull NSArray\u003cNSString *\u003e *)placeProperties;\n\n #### Parameters\n\n |-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*locationRestriction*` ` | The region to search specified as a circle, defined by center point and radius in meters. |\n | ` `*placeProperties*` ` | The array of [GMSPlaceProperty](../Type-Definitions/GMSPlaceProperty.html) 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. |\n\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)GMSPlaceSearchNearbyRequest(im)init)\n\n `\n ` \n Unavailable \n Default init is not available. Please use the designated initializer. \n\n #### Declaration\n\n Objective-C \n\n - (nonnull instancetype)init;\n\n- `\n ``\n ``\n `\n\n ### [locationRestriction](#/c:objc(cs)GMSPlaceSearchNearbyRequest(py)locationRestriction)\n\n `\n ` \n The region to search specified as a circle, defined by center point and radius in meters. The\n radius must be between 0.0 and 50000.0, inclusive. Breaking this restriction will result in an\n INVALID_ARGUMENT error. The locationRestriction must be specified with\n [GMSPlaceCircularLocationOption](../Functions/GMSPlaceCircularLocationOption.html). Using [GMSPlaceRectangularLocationOption](../Functions/GMSPlaceRectangularLocationOption.html) will result in an\n INVALID_REQUEST error. \n\n #### Declaration\n\n Swift \n\n @NSCopying var locationRestriction: any ../Protocols/GMSPlaceLocationRestriction.html { get set }\n\n Objective-C \n\n @property (nonatomic, copy) id\u003c../Protocols/GMSPlaceLocationRestriction.html\u003e _Nonnull locationRestriction;\n\n- `\n ``\n ``\n `\n\n ### [placeProperties](#/c:objc(cs)GMSPlaceSearchNearbyRequest(py)placeProperties)\n\n `\n ` \n The array of [GMSPlaceProperty](../Type-Definitions/GMSPlaceProperty.html) that should be included in place results. Must not be empty. An\n empty list will result in an error when trying to send the request. \n\n #### Declaration\n\n Swift \n\n var placeProperties: [String] { get set }\n\n Objective-C \n\n @property (nonatomic, copy) NSArray\u003cNSString *\u003e *_Nonnull placeProperties;\n\n- `\n ``\n ``\n `\n\n ### [includedTypes](#/c:objc(cs)GMSPlaceSearchNearbyRequest(py)includedTypes)\n\n `\n ` \n The array of place types to include in a search. Up to 50 types can be specified. If a request is\n specified with multiple type restrictions, only places that satisfy all of the restrictions are\n returned. If the array is empty, then all places of all types are returned. See Table A for a\n list of supported types\n \u003chttps://developers.google.com/maps/documentation/places/web-service/place-types#table-a\u003e. \n\n #### Declaration\n\n Swift \n\n var includedTypes: [String]? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSArray\u003cNSString *\u003e *includedTypes;\n\n- `\n ``\n ``\n `\n\n ### [excludedTypes](#/c:objc(cs)GMSPlaceSearchNearbyRequest(py)excludedTypes)\n\n `\n ` \n The array of place types to exclude from a search. Up to 50 types can be specified. If a request\n is specified with multiple type restrictions, only places that satisfy all of the restrictions\n are returned. If conflicting types are specified (e.g., types appearing in includedTypes and\n excludedTypes), an INVALID_REQUEST error is returned. See Table A for a list of supported types\n \u003chttps://developers.google.com/maps/documentation/places/web-service/place-types#table-a\u003e. \n\n #### Declaration\n\n Swift \n\n var excludedTypes: [String]? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSArray\u003cNSString *\u003e *excludedTypes;\n\n- `\n ``\n ``\n `\n\n ### [includedPrimaryTypes](#/c:objc(cs)GMSPlaceSearchNearbyRequest(py)includedPrimaryTypes)\n\n `\n ` \n The array of primary place types to include in a search. Up to 50 types can be specified. If a\n request is specified with multiple type restrictions, only places that satisfy all of the\n restrictions are returned. For more information about primary types see:\n \u003chttps://developers.google.com/maps/documentation/places/web-service/nearby-search#includedtypesexcludedtypes,-includedprimarytypesexcludedprimarytypes\u003e \n\n #### Declaration\n\n Swift \n\n var includedPrimaryTypes: [String]? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSArray\u003cNSString *\u003e *includedPrimaryTypes;\n\n- `\n ``\n ``\n `\n\n ### [excludedPrimaryTypes](#/c:objc(cs)GMSPlaceSearchNearbyRequest(py)excludedPrimaryTypes)\n\n `\n ` \n The array of primary places types to exclude from a search. If conflicting types are specified\n (e.g., types appearing in includedTypes and excludedTypes), an INVALID_REQUEST error is returned.\n Up to 50 types can be specified. If a request is specified with multiple type restrictions, only\n places that satisfy all of the restrictions are returned. For more information about primary\n types see:\n \u003chttps://developers.google.com/maps/documentation/places/web-service/nearby-search#includedtypesexcludedtypes,-includedprimarytypesexcludedprimarytypes\u003e \n\n #### Declaration\n\n Swift \n\n var excludedPrimaryTypes: [String]? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSArray\u003cNSString *\u003e *excludedPrimaryTypes;\n\n- `\n ``\n ``\n `\n\n ### [maxResultCount](#/c:objc(cs)GMSPlaceSearchNearbyRequest(py)maxResultCount)\n\n `\n ` \n The maximum number of [GMSPlace](../Classes/GMSPlace.html) results to return. Must be between 1 and 20 (default)\n inclusive. Breaking this restriction will result in an error returned. \n\n #### Declaration\n\n Swift \n\n var maxResultCount: Int { get set }\n\n Objective-C \n\n @property (nonatomic) NSInteger maxResultCount;\n\n- `\n ``\n ``\n `\n\n ### [regionCode](#/c:objc(cs)GMSPlaceSearchNearbyRequest(py)regionCode)\n\n `\n ` \n The unicode country/region code (CLDR) of the location where the request is coming from.\n See \u003chttps://www.unicode.org/cldr/charts/44/supplemental/territory_language_information.html\u003e for\n region codes. \n\n #### Declaration\n\n Swift \n\n var regionCode: String? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSString *regionCode;\n\n- `\n ``\n ``\n `\n\n ### [rankPreference](#/c:objc(cs)GMSPlaceSearchNearbyRequest(py)rankPreference)\n\n `\n ` \n The [GMSPlaceSearchNearbyRankPreference](../Enums/GMSPlaceSearchNearbyRankPreference.html) used to sort the results returned from the request.\n The default value is `GMSPlaceSearchNearbyRankPopularity`. \n\n #### Declaration\n\n Swift \n\n var rankPreference: ../Enums/GMSPlaceSearchNearbyRankPreference.html { get set }\n\n Objective-C \n\n @property (nonatomic) ../Enums/GMSPlaceSearchNearbyRankPreference.html rankPreference;"]]