i am trying to get user geoLocation by his Ip , so i tried calling googleapi inside my lambda function
const getLatLng = () => axios
.post(`https://www.googleapis.com/geolocation/v1/geolocate?key=${key}`)
.then(({ data }) => data);
Now the strange part is, when I run my node project locally and call the endpoint, it works really good and it detect my ip and return my correct lat and lng - then I use the same code after I deploy the service to api gateway in aws, and it return my lat lng wrong, so the request works but the value is wrong.
Does anyone know what might be the reason? Is it true that i should call googleapi from my client and pass lat and lng to my server and then use them for my other calculations and stuff i ineed ?