Skip to content
Advertisement

API to get all the reviews and rating from Google for business

I am using the Google Maps API to get the reviews and ratings for a company.

Step 1: HTTP Request to get the reference Id.

$url = 'https://maps.googleapis.com/maps/api/place/textsearch/json?query='.<CompanyName>.'&sensor=true&key='.<apikey>;

After HTTP request I am getting referenceId of business.

Step 2: HTTP request to get the reviews.

$url = 'https://maps.googleapis.com/maps/api/place/details/json?reference='.<referenceId>.'&key='.<apiKey>

With the above, I am getting the “most helpful reviews” and a maximum of 5 reviews.

So I want to get all the reviews or the latest reviews. Do I need to add a parameter?

Advertisement

Answer

You should need to use the Google My Business API if you want to get all the reviews.

It’s another different API, and you should request from Google the property of the place.

https://developers.google.com/my-business/content/review-data#list_all_reviews

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement