Search code examples
google-mapsblockinggoogle-maps-static-api

Is Google Maps blocking me?


I'm programming web application that works with Google Maps and I need to generate PDF output so I decided to use static API. My application will be using set of 1500 small map images (100*100px). I dont want to ask Google for every image thousand times a day so I wrote a script to download all images and save it to my server where images will be used from. After downloading 300 images my server gets this error:

Warning: readfile(http://maps.googleapis.com/maps/api/staticmap?size=100x100&maptype=roadmap&markers=icon:http://mediup.martinstrouhal.cz/arrs/210.png%7Cshadow:false%7C50.078522,14.436551&sensor=false&zoom=16) [function.readfile]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden

Does this mean that google is blocking me permanently?


Solution

  • It's likely that Google Maps has a throttle on it that will cut off anyone abusing the API. Since you are just storing the images, put a random wait in between each request and let it run for a long time until you get all the images you need.