user2489846
user2489846

Reputation: 91

Google Places Web Service API returning different results on different servers?

I'm using the Google Places Web Service API for a website. I'm getting the place details using the place_id and getting the 5 reviews that google will send. My understanding is that the Google Places API always sends the "Most Helpful" 5 reviews. It appears though that I'm getting a different results set of reviews when running the same query on the web server!

Here's the URL I'm using: https://maps.googleapis.com/maps/api/place/details/json?placeid=[PLACE_ID]&key=[API_KEY] <-- with the place and api key filled in.

I'm getting completely different reviews running this exact same command from my machine versus the web server. All of the reviews are valid and other than the reviews and "reference" fields, the returned JSON is the same.

I've run it using curl on command line as well as just using a browser locally I always get the results I'd expect to see. I made a simple PHP curl script and put in the exact same script on the remote web server and on a local web server (apache w/ PHP) and I still get different results! What is happening?? Thanks!

Upvotes: 4

Views: 602

Answers (1)

dduque
dduque

Reputation: 414

I was having a similar problem, I was able to replicate my local results in the web server by adding the locationbias and language parameters. For locationbias parameter I used point coordinates. For more information about setting these parameters, check: https://developers.google.com/maps/documentation/places/web-service/search

Upvotes: 0

Related Questions