Autocomplete a Place and Close the Session with Details
A 2-step recipe with Google Maps Platform. We can help you get access.
Recipe · 2 steps
Autocomplete a Place and Close the Session with Details
with Google Maps Platform
Resolve a partial text input into a fully detailed place within one billing session.
- Ask for predictions matching the partial input, biased toward the supplied circle. The session token issued here is what the details step must reuse.
- Read the full record for the predicted place. Passing the same sessionToken concludes the autocomplete session so the preceding keystroke requests bill as one session rather than individually.
What you'll need to have ready
- input: The partial text the user has typed so far (e.g. "1600 Amphitheatre Pk").
- sessionToken: A random string that groups this autocomplete session for billing. Mint one per user session and reuse it until a Place Details call concludes it.
- fieldMask: Comma-separated Place Details fields to return. Field masking is the primary cost lever on the Places API - request only what you render.
- languageCode: BCP-47 language code for predictions and details (e.g. "en").
- regionCode: CLDR region code used to bias results (e.g. "US").
- biasLatitude: Latitude of the circle centre used to bias predictions toward the user.
- biasLongitude: Longitude of the circle centre used to bias predictions toward the user.
- biasRadiusMeters: Radius in metres of the bias circle.
For your developer
Arazzo workflow google-maps:autocomplete-to-place-details, 2 operations: autocompletePlaces → getPlaceDetails. Specs on APIs.io.