Catch up on all the news, sessions, and announcements from Google I/O 2021. Watch now.

Get local business

Action ID
actions.intent.GET_LOCAL_BUSINESS
Description
Search for a business in an app. Filter businesses by type using the localBusiness.disambiguatingDescription intent parameter. Determine the location of the business using one of the following intent parameters, if available: localBusiness.location.name, localBusiness.location.address, or localBusiness.location.geo.latitude and localBusiness.location.geo.longitude. Otherwise, return businesses closest to the location of the user.

Locale support

Functionality Locales
Preview creation using App Actions test tool en-US
User invocation from Google Assistant en-US

Example queries

The following fields represent essential information that users often provide in queries that trigger this built-in intent:

localBusiness.disambiguatingDescription

Other supported fields

The following fields represent information that users often provide to disambiguate their needs or otherwise improve their results:

localBusiness.@type
localBusiness.location.@type
localBusiness.location.name
localBusiness.location.address
localBusiness.location.geo.@type
localBusiness.location.geo.latitude
localBusiness.location.geo.longitude

Android Slices

We recommend implementing Android Slices for this built-in intent. An Android Slice presents information or interaction options from your app to improve user engagement in the Google Assistant.

Supported text values by field





Inventory availability by field


Sample XML files

For information about the actions.xml schema, see Create actions.xml. For information about the shortcuts.xml schema, see Create shorcuts.xml.

Handle BII parameters

shortcuts.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample shortcuts.xml -->
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
  <capability android:name="actions.intent.GET_LOCAL_BUSINESS">
    <intent
      android:action="android.intent.action.VIEW"
      android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
      android:targetClass="YOUR_TARGET_CLASS">
      <!-- Eg. disambiguatingDescription = "CarWash" -->
      <parameter
        android:name="localBusiness.disambiguatingDescription"
        android:key="disambiguatingDescription"/>
      <!-- Eg. name = "Mountain View" -->
      <parameter
        android:name="localBusiness.location.name"
        android:key="name"/>
      <!-- Eg. address = "123 Easy Street, Mountain View, CA" -->
      <parameter
        android:name="localBusiness.location.address"
        android:key="address"/>
      <!-- Eg. latitude = "37.3861" -->
      <parameter
        android:name="localBusiness.location.geo.latitude"
        android:key="latitude"/>
      <!-- Eg. longitude = "-122.084" -->
      <parameter
        android:name="localBusiness.location.geo.longitude"
        android:key="longitude"/>
    </intent>
  </capability>
</shortcuts>
      

actions.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
  <action intentName="actions.intent.GET_LOCAL_BUSINESS">
    <fulfillment urlTemplate="myapp://custom-deeplink{?disambiguatingDescription,name,address,latitude,longitude}">
      <!-- e.g. disambiguatingDescription = "CarWash" -->
      <!-- (Optional) Require a field eg.disambiguatingDescription for fulfillment with required="true" -->
      <parameter-mapping urlParameter="disambiguatingDescription" intentParameter="localBusiness.disambiguatingDescription" required="true" />
      <!-- e.g. name = "Mountain View" -->
      <parameter-mapping urlParameter="name" intentParameter="localBusiness.location.name" />
      <!-- e.g. address = "123 Easy Street, Mountain View, CA" -->
      <parameter-mapping urlParameter="address" intentParameter="localBusiness.location.address" />
      <!-- e.g. latitude = "37.3861" -->
      <parameter-mapping urlParameter="latitude" intentParameter="localBusiness.location.geo.latitude" />
      <!-- e.g. longitude = "-122.084" -->
      <parameter-mapping urlParameter="longitude" intentParameter="localBusiness.location.geo.longitude" />
    </fulfillment>

    <!-- Provide a fallback fulfillment with no required parameters. For example, to your app search or router deeplink -->
    <fulfillment urlTemplate="myapp://deeplink" />
  </action>
</actions>

Use web inventory

localBusiness.disambiguatingDescription is a field that supports web inventory. In the following example, Google Assistant performs a web search for the user query and determines the fulfillment URL. Assistant filters for search results that match the provided urlFilter value of https://www.mywebsite.com/link1/.*.

shortcuts.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample shortcuts.xml -->
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
  <capability android:name="actions.intent.GET_LOCAL_BUSINESS">
    <intent
      android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
      android:targetClass="YOUR_TARGET_CLASS">
      <parameter
        android:name="localBusiness.disambiguatingDescription"
        android:key="disambiguatingDescription"/>
      <parameter
        android:name="localBusiness.location.name"
        android:key="name"/>
      <parameter
        android:name="localBusiness.location.address"
        android:key="address"/>
      <parameter
        android:name="localBusiness.location.geo.latitude"
        android:key="latitude"/>
      <parameter
        android:name="localBusiness.location.geo.longitude"
        android:key="longitude"/>
    </intent>
  </capability>
</shortcuts>
      

actions.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
  <action intentName="actions.intent.GET_LOCAL_BUSINESS">
    <!-- Use URL from entity match for deep link fulfillment -->
    <!-- Example: url = 'https://www.mywebsite.com/link1/item1' -->
    <fulfillment urlTemplate="{@url}" />

    <!-- Provide a fallback fulfillment with no required parameters. For example, to your app search or router deeplink -->
    <fulfillment urlTemplate="myapp://deeplink" />

    <!-- Define parameters with web inventories using urlFilter -->
    <parameter name="localBusiness.disambiguatingDescription">
      <entity-set-reference urlFilter="https://www.mywebsite.com/link1/.*" />"/>
    </parameter>
  </action>
</actions>

JSON-LD sample

The following JSON-LD sample provides some example values that you can use in the App Actions test tool:

{
  "@context": "http://schema.org",
  "@type": "LocalBusiness",
  "disambiguatingDescription": "CarWash",
  "location": {
    "@type": "Place",
    "address": "123 Easy Street, Mountain View, CA",
    "geo": {
      "@type": "GeoCoordinates",
      "latitude": "37.3861",
      "longitude": "-122.084"
    },
    "name": "Mountain View"
  }
}