GooglePlacesSwift Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
AutocompleteRequest
struct AutocompleteRequest
extension AutocompleteRequest : Sendable
The request for autocomplete suggestions based on a given partial query along with additional
configuring properties.
-
-
Request object to use with PlacesClient
to fetch autocomplete suggestions.
Parameters
query
|
The partial text to autocomplete.
|
sessionToken
|
|
filter
|
|
inputOffset
|
The character offset for the input string. Indicates the completion starting position.
|
-
The character offset for the input string. Indicates the completion starting position.
Declaration
Swift
var inputOffset: Int { get }
-
The partial text to autocomplete.
Declaration
Swift
var query: String { get }
-
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\u003eAutocompleteRequest\u003c/code\u003e is a struct used to request autocomplete suggestions based on a partial query.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties for the query, an optional session token for billing, and an optional filter to refine results.\u003c/p\u003e\n"],["\u003cp\u003eYou can use \u003ccode\u003eAutocompleteRequest\u003c/code\u003e with \u003ccode\u003ePlacesClient\u003c/code\u003e to fetch autocomplete suggestions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003efilter\u003c/code\u003e property uses the \u003ccode\u003eAutocompleteFilter\u003c/code\u003e struct to narrow down the suggestions based on location or place type.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esessionToken\u003c/code\u003e property leverages \u003ccode\u003eAutocompleteSessionToken\u003c/code\u003e to track and manage billing for autocomplete requests within a session.\u003c/p\u003e\n"]]],[],null,["# GooglePlacesSwift Framework Reference\n\nAutocompleteRequest\n===================\n\n struct AutocompleteRequest\n\n extension AutocompleteRequest : Sendable\n\nThe request for autocomplete suggestions based on a given partial query along with additional\nconfiguring properties.\n- `\n ``\n ``\n `\n\n ### [filter](#/s:17GooglePlacesSwift19AutocompleteRequestV6filterAA0D6FilterVSgvp)\n\n `\n ` \n The [AutocompleteFilter](../Structs/AutocompleteFilter.html) to apply to the results. \n\n #### Declaration\n\n Swift \n\n var filter: ../Structs/AutocompleteFilter.html? { get }\n\n- `\n ``\n ``\n `\n\n ### [init(query:sessionToken:filter:inputOffset:)](#/s:17GooglePlacesSwift19AutocompleteRequestV5query12sessionToken6filter11inputOffsetACSS_AA0d7SessionH0VSgAA0D6FilterVSgSitcfc)\n\n `\n ` \n Request object to use with [PlacesClient](../Classes/PlacesClient.html) to fetch autocomplete suggestions. \n\n #### Declaration\n\n Swift \n\n init(query: String, sessionToken: ../Structs/AutocompleteSessionToken.html? = nil, filter: ../Structs/AutocompleteFilter.html? = nil, inputOffset: Int = 0)\n\n #### Parameters\n\n |----------------------|----------------------------------------------------------------------------------------------------------------------|\n | ` `*query*` ` | The partial text to autocomplete. |\n | ` `*sessionToken*` ` | The [AutocompleteSessionToken](../Structs/AutocompleteSessionToken.html) to associate requests to a billing session. |\n | ` `*filter*` ` | The [AutocompleteFilter](../Structs/AutocompleteFilter.html) to apply to the results. |\n | ` `*inputOffset*` ` | The character offset for the input string. Indicates the completion starting position. |\n\n- `\n ``\n ``\n `\n\n ### [inputOffset](#/s:17GooglePlacesSwift19AutocompleteRequestV11inputOffsetSivp)\n\n `\n ` \n The character offset for the input string. Indicates the completion starting position. \n\n #### Declaration\n\n Swift \n\n var inputOffset: Int { get }\n\n- `\n ``\n ``\n `\n\n ### [query](#/s:17GooglePlacesSwift19AutocompleteRequestV5querySSvp)\n\n `\n ` \n The partial text to autocomplete. \n\n #### Declaration\n\n Swift \n\n var query: String { get }\n\n- `\n ``\n ``\n `\n\n ### [sessionToken](#/s:17GooglePlacesSwift19AutocompleteRequestV12sessionTokenAA0d7SessionG0VSgvp)\n\n `\n ` \n The [AutocompleteSessionToken](../Structs/AutocompleteSessionToken.html) to associate requests to a billing session. \n\n #### Declaration\n\n Swift \n\n var sessionToken: ../Structs/AutocompleteSessionToken.html? { get }"]]