0

I'm trying to do a Google Geocode Request with PHP, but I get a 403 Forbidden answer:

Warning: file_get_contents(http://maps.google.com/maps/api/geocode/json?address=Bahnhofstrasse+1,+Zurich&sensor=false): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in ...

With the same code on a different server the request works. Is it possible that google is blocking my requests from a specific server? Too many requests?

Here is my code:

error_reporting(E_ALL ^ E_NOTICE);
$request = file_get_contents("http://maps.google.com/maps/api/geocode/json?address=Bahnhofstrasse+1,+Zurich&sensor=false");
$json = json_decode($request, true);
print_r($json);
ccbit
  • 3
  • 1
  • 2

1 Answers1

0

Yes it is possible that you are sending too many request on the server. They are limiting API request per day per IP.

You can check more at the API website. https://developers.google.com/maps/documentation/business/articles/usage_limits

Rex Adrivan
  • 993
  • 1
  • 10
  • 23
  • It seems like I did too many requests per second with my php file. I resolved this problem with a windows task on our server. – ccbit Mar 18 '15 at 15:05