autocomplete
¶
autocomplete(
query_text: SensitiveString,
*,
config_overrides: Optional[GeoPlacesClientConfig] = None,
max_results: Optional[int] = None,
bias_position: Optional[Position] = None,
filter: Optional[AutocompleteFilter] = None,
postal_code_mode: Optional[PostalCodeMode] = None,
additional_features: Optional[AutocompleteAdditionalFeatureList] = None,
language: Optional[LanguageTag] = None,
political_view: Optional[CountryCode] = None,
intended_use: Optional[AutocompleteIntendedUse] = None,
key: Optional[ApiKey] = None,
) -> AutocompleteResponse
Autocomplete completes potential places and addresses as the user types, based on the partial input. The API enhances the efficiency and accuracy of address by completing query based on a few entered keystrokes. It helps you by completing partial queries with valid address completion. Also, the API supports the filtering of results based on geographic location, country, or specific place types, and can be tailored using optional parameters like language and political views. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.
For more information, see Autocomplete in the Amazon Location Service Developer Guide.
Parameters:
-
query_text(SensitiveString) –The free-form text query to match addresses against. This is usually a partially typed address from an end user in an address box or form.
The fields
QueryText, andQueryIDare mutually exclusive. -
max_results(Optional[int], default:None) –An optional limit for the number of results returned in a single call.
Default value: 5
-
bias_position(Optional[Position], default:None) –The position in longitude and latitude that the results should be close to. Typically, place results returned are ranked higher the closer they are to this position. Stored in
[lng, lat]and in the WGS 84 format.The fields
BiasPosition,FilterBoundingBox, andFilterCircleare mutually exclusive. -
filter(Optional[AutocompleteFilter], default:None) –A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.
-
postal_code_mode(Optional[PostalCodeMode], default:None) –The
PostalCodeModeaffects how postal code results are returned. If a postal code spans multiple localities and this value is empty, partial district or locality information may be returned under a single postal code result entry. If it's populated with the valueEnumerateSpannedLocalities, all cities in that postal code are returned. If it's populated with the valueEnumerateSpannedDistricts, all combinations of the postal code with the corresponding district and city names are returned. -
additional_features(Optional[AutocompleteAdditionalFeatureList], default:None) –A list of optional additional parameters that can be requested for each result.
-
language(Optional[LanguageTag], default:None) –A list of BCP 47 compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry.
-
political_view(Optional[CountryCode], default:None) –The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.
The following political views are currently supported:
-
ARG: Argentina's view on the Southern Patagonian Ice Field and Tierra Del Fuego, including the Falkland Islands, South Georgia, and South Sandwich Islands -
EGY: Egypt's view on Bir Tawil -
IND: India's view on Gilgit-Baltistan -
KEN: Kenya's view on the Ilemi Triangle -
MAR: Morocco's view on Western Sahara -
RUS: Russia's view on Crimea -
SDN: Sudan's view on the Halaib Triangle -
SRB: Serbia's view on Kosovo, Vukovar, and Sarengrad Islands -
SUR: Suriname's view on the Courantyne Headwaters and Lawa Headwaters -
SYR: Syria's view on the Golan Heights -
TUR: Turkey's view on Cyprus and Northern Cyprus -
TZA: Tanzania's view on Lake Malawi -
URY: Uruguay's view on Rincon de Artigas -
VNM: Vietnam's view on the Paracel Islands and Spratly Islands
-
-
intended_use(Optional[AutocompleteIntendedUse], default:None) –Indicates if the query results will be persisted in customer infrastructure. Defaults to
SingleUse(not stored). Currently,Autocompletedoes not support storage of results. -
key(Optional[ApiKey], default:None) –Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this action.
-
InternalServerException–The request processing has failed because of an unknown error, exception or failure.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by an AWS service.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_geo_places/_services/geo_places.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |