Reputation: 2028
Problem: Same URL template, but different behaviours, for different PlaceId's.
I did some digging and found two templates for reviews:
A) ReviewLink = $"https://search.google.com/local/writereview?placeid={SelectedPlaceId}";
and
B) ReviewLink = $"https://g.page/r/{UniqueBusinessId}/review";
B is a newer (?) format, and I found nothing in the API yet to fetch the UniqueBusinessID using a business name, or phone, or address. You get this URL from the business profile manager.
A - seems to be a standard, and I was able to retrieve via the API the PlaceId. Which I then inserted using SelectedPlaceId.
My testing seems to give me a random behaviour however across different PlaceId retrieved via the API.
One is the business profile page, and quickly open the Review page popup, the other seem to land on just the business review page, and skips the popup (ARGH!)
Any one know why the behaviour is different?
Stretch Goal: var requestUri = $"https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input={Uri.EscapeDataString(businessName)}&inputtype=textquery&fields=place_id,name&key={_apiKey}";
Only ever seems to return 0 to 1 business, regardless of what I search for. Its an array that is returned, so I thought for sure I could get multiple results.
I tried various PlaceID, and found the behaviour to be random depending on the placement id.
Upvotes: 0
Views: 64
Reputation: 4865
The only API available(*) to obtain such URLs is the Business Profile APIs (mybusiness.googleapis.com
), which provides a newReviewUrl
as part of a business' Metadata.
(*) This API is not generally available, you'd need to request access.
There is no equivalent functionality in the Places API (or any of the Google Maps Platform Core Services). There is a feature request for the Maps URLs service here: https://issuetracker.google.com/73246452#comment4
Upvotes: 0