I am calling Google Places Autocomplete API from a web server, so when the client code is unable to capture latitude/longitude from the browser, location biasing will always be based on my server's IP address by default. I am trying to find a way to pass to Google the client's IP address instead of it using mine. I have captured the client IP on my server API, but there doesn't seem to be any way to forward that in an Autocomplete request.
From the documentation, Google states:
Note: If you do not supply the location and radius, the API will attempt to detect the user's location from their IP address, and will bias the results to that location.
I've attempted to add different headers to the Autocomplete Request, but they are all ignored and still bias results on my server IP. Maybe I haven't found the correct header.
//pseudo C#
headers.Add("X-ProxyUser-Ip", "172.217.5.228");
headers.Add("X-Forwarded-For", "172.217.5.228");
Is there a proper way to forward a client IP from my server to Google API?
src: https://developers.google.com/places/web-service/autocomplete#location_biasing