Google Maps Geocode Status OVER_QUERY_LIMIT

12,551

Solution 1

The quota is shared among all the users of the shared IP, so other sites on the same shared IP must be using the Google Geocoder.

See this thread in the Google Maps API v2 group for more information.

BTW - rackspace was a guess...

A workaround would be to use client based geocoding, but verify your use complies with the terms of use.

The webservice now supports a key, another option is to use a key in your request so you get your own quota.

Solution 2

Maybe you are sending too many queries per second?

Check out this thread:

OVER_QUERY_LIMIT while using google maps

Solution 3

I faced a similar issue to this with my heroku hosted java application. The way I got around it was to set up a micro EC2 instance and install Dante on it to run as a proxy server. Then I just route my gecoding requests through the proxy and can make the full 2,000 requests per day. Obviously it's worth caching results to minimise the api calls too. The EC2 instance is free for the first year and after that still not that expensive and you can always use it for more than just Dante.

I've written details of how I set this up here: Using Google geocoding from Heroku

Share:
12,551
dcolumbus
Author by

dcolumbus

Updated on June 04, 2022

Comments

  • dcolumbus
    dcolumbus almost 2 years

    I understand that Google caps requests to 2,500 per day... but there's no way on EARTH that I've made that many requests today, and I just keep getting 'OVER_QUERY_LIMIT'

    $street_no = get_post_meta($prop->ID, 'street_no', true);
    $street = get_post_meta($prop->ID, 'street', true);
    $street_suffix = get_post_meta($prop->ID, 'street_suffix', true);
    
    $addr = urlencode( $street_no." ".$street." ".$street_suffix." BC Canada" );
    $url = 'http://maps.googleapis.com/maps/api/geocode/json?address='.$addr.'&sensor=true';
    $json_result = json_decode(file_get_contents($url));
    
    if ( $json_result->status === "OVER_QUERY_LIMIT" ) :
        sleep(2);
        $json_result = json_decode(file_get_contents($url));
    endif;
    

    As you can see, if I get the status of OVER_QUERY_LIMIT I tell the script to sleep for 2 seconds and then continue on... which seemed to work at some point this morning, but now I just can't even get a single address geocoded.

    I'm at a loss as to what to do at this point... it makes my application utterly useless.

  • dcolumbus
    dcolumbus about 11 years
    I actually found that link earlier, and it really doesn't tell me anything good.