When I fetch Google Maps Geocoding API from my browser, it's working, but not from my PHP script.
Returns :
{
"results" : [
{
"address_components" : [
{
"long_name" : "La Pérelle",
"short_name" : "La Pérelle",
"types" : [ "colloquial_area", "political" ]
},
],
"formatted_address" : "La Pérelle, 38380, France",
// other stuffs
"partial_match" : true,
"place_id" : "ChIJZzDRRAX4ikcRnZ-vb1tnTgY",
"types" : [ "colloquial_area", "political" ]
}
],
"status" : "OK"
}
Not working :
<?php
$url = 'https://maps.google.com/maps/api/geocode/json?sensor=false&key=AIzaSyDqIj_SXTf5Z5DgE_cvn5VF9h5NbuaiCbs&address=La%20P%C3%A9relle,%20Saint-Pierre-de-Chartreuse,%20France';
echo file_get_contents($url);
Returns:
{
"results" : [],
"status" : "ZERO_RESULTS"
}
Any ideas?
Update : some people are not seeing any results from their browser too. Could Google use my position to show decent results?