Google Maps Platform · Arazzo Workflow

Google Maps Autocomplete a Place and Close the Session with Details

Version 1.0.0

Run a session-tokened autocomplete request, then fetch details for the chosen prediction using the same session token.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub EnvironmentGeocodingGeolocationMapsNavigationPlacesRoutingSolarArazzoWorkflows

Provider

google-maps

Workflows

autocomplete-to-place-details
Resolve a partial text input into a fully detailed place within one billing session.
Requests autocomplete predictions for a partial input, confirms at least one suggestion came back, and then reads the full record for the predicted place while passing the same session token to terminate the session.
2 steps inputs: biasLatitude, biasLongitude, biasRadiusMeters, fieldMask, input, languageCode, regionCode, sessionToken outputs: displayName, formattedAddress, latitude, longitude, placeId
1
autocompleteInput
Ask for predictions matching the partial input, biased toward the supplied circle. The session token issued here is what the details step must reuse.
2
resolvePredictionDetails
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.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Google Maps Autocomplete a Place and Close the Session with Details
  summary: Run a session-tokened autocomplete request, then fetch details for the chosen prediction using the same session token.
  description: >-
    The canonical Places API (New) typeahead pattern, and the one that decides
    what you get billed. Autocomplete requests carry a session token; the
    session is only concluded when a Place Details call reuses that same token,
    which is what collapses a burst of keystroke requests into a single billable
    session. This workflow does exactly that: it autocompletes an input string,
    takes the first prediction, and resolves it through Place Details with the
    token carried across. Every step spells out its request inline so the flow
    can be read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: autocompleteApi
  url: ../openapi/google-maps-autocomplete-api-openapi.yml
  type: openapi
- name: placeDetailsApi
  url: ../openapi/google-maps-place-details-api-openapi.yml
  type: openapi
workflows:
- workflowId: autocomplete-to-place-details
  summary: Resolve a partial text input into a fully detailed place within one billing session.
  description: >-
    Requests autocomplete predictions for a partial input, confirms at least one
    suggestion came back, and then reads the full record for the predicted place
    while passing the same session token to terminate the session.
  inputs:
    type: object
    required:
    - input
    - sessionToken
    properties:
      input:
        type: string
        description: The partial text the user has typed so far (e.g. "1600 Amphitheatre Pk").
      sessionToken:
        type: string
        description: >-
          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:
        type: string
        description: >-
          Comma-separated Place Details fields to return. Field masking is the
          primary cost lever on the Places API - request only what you render.
        default: id,displayName,formattedAddress,location,rating,userRatingCount,websiteUri,regularOpeningHours
      languageCode:
        type: string
        description: BCP-47 language code for predictions and details (e.g. "en").
        default: en
      regionCode:
        type: string
        description: CLDR region code used to bias results (e.g. "US").
        default: US
      biasLatitude:
        type: number
        description: Latitude of the circle centre used to bias predictions toward the user.
      biasLongitude:
        type: number
        description: Longitude of the circle centre used to bias predictions toward the user.
      biasRadiusMeters:
        type: number
        description: Radius in metres of the bias circle.
        default: 5000
  steps:
  - stepId: autocompleteInput
    description: >-
      Ask for predictions matching the partial input, biased toward the supplied
      circle. The session token issued here is what the details step must reuse.
    operationId: autocompletePlaces
    requestBody:
      contentType: application/json
      payload:
        input: $inputs.input
        sessionToken: $inputs.sessionToken
        languageCode: $inputs.languageCode
        regionCode: $inputs.regionCode
        includeQueryPredictions: false
        locationBias:
          circle:
            center:
              latitude: $inputs.biasLatitude
              longitude: $inputs.biasLongitude
            radius: $inputs.biasRadiusMeters
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.suggestions.length > 0
      type: jsonpath
    outputs:
      predictedPlaceId: $response.body#/suggestions/0/placePrediction/placeId
      predictedPlaceResourceName: $response.body#/suggestions/0/placePrediction/place
      predictedText: $response.body#/suggestions/0/placePrediction/text/text
      predictedMainText: $response.body#/suggestions/0/placePrediction/structuredFormat/mainText/text
      predictedSecondaryText: $response.body#/suggestions/0/placePrediction/structuredFormat/secondaryText/text
      suggestions: $response.body#/suggestions
  - stepId: resolvePredictionDetails
    description: >-
      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.
    operationId: getPlaceDetails
    parameters:
    - name: placeId
      in: path
      value: $steps.autocompleteInput.outputs.predictedPlaceId
    - name: X-Goog-FieldMask
      in: header
      value: $inputs.fieldMask
    - name: sessionToken
      in: query
      value: $inputs.sessionToken
    - name: languageCode
      in: query
      value: $inputs.languageCode
    - name: regionCode
      in: query
      value: $inputs.regionCode
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      placeId: $response.body#/id
      placeResourceName: $response.body#/name
      displayName: $response.body#/displayName/text
      formattedAddress: $response.body#/formattedAddress
      latitude: $response.body#/location/latitude
      longitude: $response.body#/location/longitude
      rating: $response.body#/rating
      userRatingCount: $response.body#/userRatingCount
      websiteUri: $response.body#/websiteUri
      openNow: $response.body#/regularOpeningHours/openNow
  outputs:
    placeId: $steps.resolvePredictionDetails.outputs.placeId
    displayName: $steps.resolvePredictionDetails.outputs.displayName
    formattedAddress: $steps.resolvePredictionDetails.outputs.formattedAddress
    latitude: $steps.resolvePredictionDetails.outputs.latitude
    longitude: $steps.resolvePredictionDetails.outputs.longitude

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/google-maps-autocomplete-to-place-details-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.