Why our website could only show 5 Google reviews
We wanted real Google reviews on brandzaha.com. Google’s API had a limit we didn’t expect, plus an IPv6 surprise. A short dev diary on what happened and the right way to do it.
We wanted the reviews on brandzaha.com to be real. No hand-picked quotes, no stock photos: the same reviews people see on our Google profile, pulled straight from Google.
Step 1: the obvious tool
Google’s Places API gives a business’s rating, review count and reviews with one API key. We built the reviews section, added the key to our server, and… nothing showed up.
The IPv6 surprise
We had locked the key to our server’s IP address, which is the right thing to do. Our test from the server worked, but the website itself was talking to Google over IPv6, and only the IPv4 address was on the allowed list. Google answered every request with “Permission denied”. Adding the server’s IPv6 address to the key fixed it in one line.
Then the real limit: 5 reviews
The reviews appeared: five of them. That isn’t a bug. The Places API returns at most five reviews for a business, and Google picks which five. The older version of the API could sort by newest to fetch a different five, but it can no longer be switched on for new Google Cloud projects.
The right tool: Business Profile API
The owner of a Google Business Profile can use the Business Profile API, which returns every review. It isn’t open to everyone: you apply, explain why you need it, and Google reviews the request, which can take up to two weeks. We’ve applied. Until it’s approved, our site shows the five reviews Google sends.
Our take
- Read an API’s limits before you design the feature. “Show our reviews” sounds like one call, but the answer depends on who you are to Google: a visitor or the owner.
- Restrict every API key, and test it from the same machine and the same network route your app uses: IPv4 and IPv6.
- Don’t fake it. Real reviews with real names are worth more than polished quotes, even if there are only five for a while.
We’ll update this post when the approval comes through.