API Connector Documentation
Import Google Business Profile Data to Google Sheets
In this guide, we’ll walk through how to pull Google Business Profile (aka Google My Business) API data directly into Google Sheets, using the API Connector add-on for Sheets.
Contents
- Before You Begin
- Part 1: Connect to the Google Business Profile API
- Part 2: Pull Google Business Data into Sheets
- Part 3: Create a Custom API Request
- Part 4: Handle Pagination
- Part 5: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Connect to the Google Business Profile API
The easiest way to get started with the Google Business Profile API is through API Connector's built-in integration.
- In Sheets, open API Connector and create a new request (Extensions > API Connector > Open > Create request)
- Select Google Business from the drop-down list of applications
- Under Authorization, click Connect to Google My Business
- You will be directed to google.com and asked to allow Mixed Analytics to access your Google business listings. Click Allow.
- You'll then be returned to your Google Sheet, and can verify that your Google Business connection is active in the Connections screen.
Part 2: Pull Google Business API Data into Sheets
Now that we’re connected, let’s pull some data into Sheets. We'll first fetch the IDs we need for subsequent requests.
Request #1 - account IDs
For this first example, you'll fetch the account IDs to which you have access.
- Select the
/v1/accounts/
endpoint. - In the "Path parameters" section, set the
subdomain
parameter tomybusinessaccountmanagement
. This is the required subdomain for this endpoint, so there are no other options. - Optionally add a filter or change the
pageSize
parameter. - Choose a destination sheet, name your request, and hit Run. A moment later you'll see the response data in your sheet.
- Note the numeric value located in the
accounts.name
field, after "accounts/". This is your account ID, which you'll use in the next request.
Request #2 - location IDs
In this next example, we'll get the business location ID, hours, and other data.
- Select the
/v1/accounts/{account_id}/locations
endpoint - In the "Path parameters" section, populate the
account_id
parameter with the account ID you retrieved in the first request. Also set thesubdomain
parameter tomybusinessbusinessinformation
(again, this is the only option). - In the "Request parameters" section, use the
readMask
parameter to select the fields you'd like to see in your report. This is required. - Optionally set other parameters, e.g. filters and sort.
- Choose a destination sheet, name your request, and hit Run. A moment later you'll see the location response data in your sheet.
- As before note the numeric ID. This is your location ID, which you'll use in most subsequent requests.
You can now plug the account and location IDs into the other available endpoints to fetch performance metrics and business reviews.
Part 3: Create a Custom API Request
Alternatively, you can create a custom request instead of using API Connector’s built-in integration, using any of the endpoints and parameters shown in the API documentation. Here's an example request setup:
- Open up Google Sheets and click Extensions > API Connector > Open > Create request.
- In the request form enter the following, substituting in your own location ID where it says
your_location_id
:- Application:
Custom
- Method:
GET
- Request URL:
https://businessprofileperformance.googleapis.com/v1/locations/your_location_id:fetchMultiDailyMetricsTimeSeries?dailyMetrics=WEBSITE_CLICKS&dailyMetrics=CALL_CLICKS&dailyRange.start_date.year=2023&dailyRange.start_date.month=1&dailyRange.start_date.day=1&dailyRange.end_date.year=2023&dailyRange.end_date.month=10&dailyRange.end_date.day=31
- OAuth:
Google My Business
- Application:
- Create a new tab and click Set current to use that tab as your data destination.
- Name your request and click Run.
Part 4: Handle Pagination
By default, the Google Business API will limit records returned in the response. To get more records, set the pageSize
parameter to 50 or 100 as shown in the examples above (different endpoints have different pageSize
limits).
If you need more records after that, you can loop through them using pagination handling:
- Pagination type:
cursor
- Next token parameter:
pageToken
- Next token path:
nextPageToken
- Run until: choose when to stop running the request
Part 5: API Documentation
Official API documentation: https://developers.google.com/my-business/reference/rest
Hi Support Team,
How can i get month wise?
Hi - what data specifically do you want by month?
Hello lan
We need Business Profile interactions
, Calls made from your Business Profile, Website clicks made from your Business Profile
Let me know how can i get these data by month wise
Please use the "Fetch Performance Metrics" endpoint and set the dailyMetrics parameter to CALL_CLICKS and and WEBSITE_CLICKS, and then set the start date and end date parameters to be the beginning and end of the month.