I am trying to develop a small client to geocode the address and display it on the map. It all works fine, but I wanted to provide the api key so I can check the number of requests. I am using curl and php.
Here is the code:
$url = 'http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=GIVEN_ADDRESS&key=API_KEY';
$client = curl_init();
curl_setopt($client, CURLOPT_URL, $url);
curl_setopt($client, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($client);
//$http_status = curl_getinfo($client, CURLINFO_HTTP_CODE);
curl_close($client);
When I try this i get request denied from google.
any suggestions?
please provide full URL of request or use this one for test http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=USA (works for me)