Introducing insights in the Google My Business API



Today we are introducing business location insights in the Google My Business API to make it easier for third-party application developers and large multi-location brands to programmatically access location insights such as total number of searches, views and actions that let business owners track and analyze where and how people are finding them on Google.

Developers can now use the Google My Business API to request up to 18 months worth of data for each of their business locations and build applications that aggregate and visualize these insights in actionable ways. For example, a coffee shop with hundreds of locations can now easily compare and understand trends across their different locations such as number of user views, click requests for directions, phone calls, and more. They can use these insights to better allocate resources across locations and track how marketing activities affect their business.

This new API functionality brings the features from our Google My Business dashboard into your own data analysis tools. Web interface users might generate a chart of the last 90 days of Google My Business information:
Example data visible via the Google My Business web dashboard

Now the underlying data is available via the API. It's easy to get started with our new developer documentation. Here's a simple HTML request that provides a breakdown of how many searches a business listing is getting on Google Search and Google Maps:

REQUEST:
POST https://mybusiness.googleapis.com/v3/123456/locations:reportInsights
{
  "locationNames": [
    “accounts/110714876951578713336/locations/14372810722634034850”,
  ],
  “basicRequest” : {
          "metricRequests": [
             {
               "metric": QUERIES_DIRECT,
             },
             {
               "metric": QUERIES_INDIRECT,
             }
          ],
          "timeRange": {
               "startTime": 2016-10-12T01:01:23.045123456Z,
               "endTime": 2017-01-10T23:59:59.045123456Z,
          },
    },
}

RESPONSE:
{
  "locationMetrics": [
    {
      "locationName": "accounts/110714876951578713336/locations/
                       14372810722634034850",
      "timeZone": "America/Los_Angeles",
      "metricValues": [
        {
          "metric": "QUERIES_DIRECT",
          "totalValue": {
            "metricOption": "AGGREGATED_TOTAL",
            "timeDimension": {
              "timeRange": {
                "startTime": "2016-10-12T04:00:00Z",
                "endTime": "2017-01-10T04:00:00Z"
              }
            },
            "value": "36738"
          }
        },
        {
          "metric": "QUERIES_INDIRECT",
          "totalValue": {
            "metricOption": "AGGREGATED_TOTAL",
            "timeDimension": {
              "timeRange": {
                "startTime": "2016-10-12T04:00:00Z",
                "endTime": "2017-01-10T04:00:00Z"
              }
            },
            "value": "81770"
          }
        }
      ]
    }
  ]
}

Here is an example that captures insights on the places from where customers request driving directions to a business:

REQUEST:
POST https://mybusiness.googleapis.com/v3/123456/locations:reportInsights
{
     “locationNames": [
             “accounts/110714876951578713336/locations/14372810722634034850”,
       ],
      "drivingDirectionsRequest”: {
            "numDays": NINETY,
      },
}

RESPONSE (truncated to show first 3 results):
{
  "locationDrivingDirectionMetrics": [
    {
      "locationName": "accounts/110714876951578713336/locations/
                       14372810722634034850",
      "topDirectionSources": [
        {
          "dayCount": 90,
          "regionCounts": [
            {
              "latlng": {
                "latitude": 37.789,
                "longitude": -121.392
              },
              "label": "94105",
              "count": "2980",
            },
            {
              "latlng": {
                "latitude": 37.779,
                "longitude": -122.421
              },
              "label": "94102",
              "count": "887",
            },
            {
              "latlng": {
                "latitude": 37.773,
                "longitude": -122.410
              },
              "label": "94103",
              "count": "886",
            }
          ]
        }
      ],
          "timeZone": "America/Los_Angeles"
    }
  ]
}
Example data visible via the Google My Business web dashboard

With this new feature, Google My Business API users can optimize their listings to drive customer actions through understanding key insights about how customers are searching for their business on Google, and what actions they are taking once they find it. These insights are also available on Google My Business web and mobile, allowing users to keep track of key trends from anywhere.

To learn more about the Google My Business API and to apply for access, visit our developer page. Questions or feedback? Contact the API team on the Google My Business API Forum.