AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

My Business
2.6K members online now
2.6K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

Question about using GMB API to get Reviews

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

On this page https://developers.google.com/my-business/reference/rest/v3/accounts.locations.reviews/list it says i need account_name and location_name to get reviews for a business. How do i find the account name and location_name for a business. For eg: I'm looking to get reviews from a car dealership like https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=diver%20chevrolet&lrd=0...,

 

 

HTTP request

GET https://mybusiness.googleapis.com/v3/{name=accounts/*/locations/*}/reviews

 

1 Expert replyverified_user

Re: Question about using GMB API to get Reviews

Google Employee
# 2
Google Employee

Hi @Jayesh G,

 

You can list all locations for the specified account to retrieve a list of Location objects, which each contains the name field of the Location object that’s the Google identifier for the location in the form:

accounts/{account_id}/locations/{location_id}

 

You should check the isVerified boolean field of the LocationState object in each location to find out if a location is verified since only a verified location can have reviews. If the isVerified boolean field doesn’t exist in a specific location, that location is not verified.

 

You can then use the name field value for a specific verified location to list all reviews for this specified location.

 

I suggest you read through the Prerequisites and follow the Make a simple HTTP request step-by-step guide on the Google Developers site to learn how to use the OAuth 2.0 Playground for troubleshooting errors with detailed error messages when sending requests with data via the Google My Business API.

 

Thanks,

Terry

Re: Question about using GMB API to get Reviews

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Just give you a brief overview - I created a service account in Google Project console and trying to do a server to server auth so there's no user interaction.

How can i get the account_name for a business so i can get all locations? For eg i'm trying to get reviews for Diver Chevrolet Car dealer

here's the google's review page data that i'm trying to get. https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=diver%20chev%20reviews&...,

Re: Question about using GMB API to get Reviews

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
sorry i did not tag you earlier so tagging here @Terry W

Re: Question about using GMB API to get Reviews

[ Edited ]
Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

@Terry W Can you help please ? we're trying to get our customer's review data.

Today with Google Places API, we are able to use the API key (generated in google project console) and use places search api to find the location and get the reviews without having any user interaction. We're migrating to GMB API to get similar data. I would appreciate if you can help us move forward.

Re: Question about using GMB API to get Reviews

Google Employee
# 6
Google Employee

Hi @Jayesh G,

 

I recommend you use the OAuth 2.0 Playground to try to list all reviews for the specified location via the Google My Business API before jumping into coding using client libraries. If you have followed through the Make a simple HTTP request step-by-step guide on the Google Developers site as I have previously suggested, you should’ve been able to list all accounts for the logged in user and receive a JSON payload that includes a list of Account objects (or an Account object if you only have a personal account and no business accounts) that each has a respective name field which is exactly the account_name for an account. You can then follow instructions on the Google Developers site to list all locations for the specified account and list all reviews for the specified location.

 

I don’t know your programming language preference, but this Accepted Solution should explain how you need to request user consent at least once for the Google Account you want to access the locations from when using a service account, and impersonate a user account if you have delegated domain-wide access to the service account.

 

Please note that the difference between the Google Places API and the Google My Business API in terms of reviews is that the Google Places API only provides read-only access to reviews for your business locations while the Google My Business API also allows you to reply to a specified review and delete a review reply for your business locations.

 

Thanks,

Terry