Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get all google reviews using business api

I need all google reviews for particular location but I am unable to use business api from google. Here is url for get request

https://mybusiness.googleapis.com/v3/accounts/account_name/locations/location_name/reviews 

Now my question is what is the value for param account_name and location_name How can I get that.

Please answer with sample location example

like image 568
Bhavesh Nariya Avatar asked Dec 08 '16 07:12

Bhavesh Nariya


People also ask

How do I see all Google reviews for a business?

On your computer, open Google Maps. Search for a place. Below the place's name, you can find a rating. To read reviews, on the right of the rating, click the number of reviews.


2 Answers

I think first of all you need to white list your google my business api for whatever project you are working on in your project as its private api. Google my business api will work on the locations associated with your account so make sure you verified the LOCATIONS from any account you know. Then you can try out the api call you mentioned in OAuthplayground.

  1. Follow steps mentioned in below documentation URL to set it up: https://developers.google.com/my-business/content/prereqs

After the setup and etc you will automatically understand the account id and location id.

Also few more urls you can go to understand it better.

  1. https://console.developers.google.com (here you will setup your project)
  2. https://business.google.com/manage (here you will add/can see the locations - for which you need reviews)
  3. https://developers.google.com/my-business/content/basic-setup (Steps after completing the prereq)
  4. https://developers.google.com/oauthplayground (You will test the my business api here after approval)
like image 52
Hmmm Avatar answered Oct 21 '22 07:10

Hmmm


When you make a request to https://mybusiness.googleapis.com/v3/accounts it gives you a list of accounts. On those accounts they have a field called name. That field is accounts/account_name.

{
  "state": {
    "status": "UNVERIFIED"
  }, 
  "type": "PERSONAL", 
  "name": "accounts/1337", 
  "accountName": "example"
}

When you make a request to https://mybusiness.googleapis.com/v3/accounts/account_name/locations it gives you a list of locations. On those locations they have a field called name. That field is accounts/account_name/locations/location_name.

{
  "locations": [
    {
      "languageCode": "en", 
      "openInfo": {
        "status": "OPEN", 
        "canReopen": true
      }, 
      "name": "accounts/1337/locations/13161337", 
      ...
}
like image 33
B.Adler Avatar answered Oct 21 '22 06:10

B.Adler