I have the same question as in the link below. That question remains unanswered: Why different requests return same geolocation with google geolocation api
I have the same question, Why do I get the same google data response on every request? The data I get is always the same.
If I send the curl POST request to Google, I get the same response no matter the value in the JSON key value.
If I send POST request using Python 2.7 using requests I always to the same response no mater the value I set in my variable use for the URL POST request.
Any ideals, what key values would be needed, so I can pull the desired data. For example I want to parse the "locationAreaCode" for various area codes, and I want the request to return the "lat" and "lng" for each lookup.
Using the terminal in MAC OS:
curl -d @your_filename.json -H "Content-Type: application/json" -i https://www.googleapis.com/geolocation/v1/geolocate?key=[use your Google API key]
Note: "your_filename.json" is the literal name for the .json file. This .json file is currently configured below(I have tried various key values):
[
"cellTowers",
[
"locationAreaCode",
415
]
]
When I use python 2.7 with the request syntax, I will get a "response 200" and I will get the exact same data returned.
I always get the same response: Confirming Status Code is: 200
This is the POST url sent to Google [link - had to remove since new user to stackoverflow] Data Returned on the POST request is:
{
"location": {
"lat": 25.7459338,
"lng": -80.30449569999999
},
"accuracy": 37571.0
}
Output from python 2.7:
python API_json2-6.py
[link - had to remove since new user to stackoverflow]
Status Code is: 200
Confirming Status Code is: 200
This is the POST url sent to Google
https://www.googleapis.com/geolocation/v1/geolocate?key=[your google api KEY]&locationAreaCode=415
Data Returned on the POST request is:
{
"location": {
"lat": 25.7459338,
"lng": -80.30449569999999
},
"accuracy": 37571.0
}
Thanks!