-1

I know there are others questions with the same problem but i don't find the solution in them. In my rails project(it is in development) when i try to send address for the first time at day the geocoder don't search lat and long. In the terminal i'm receive the message: Google API error: over query limit. I did not reach the google query limit per/hour, per/day and don't know how resolve this.

Léo Rocha
  • 324
  • 3
  • 13
  • You need to cache lookups or otherwise optimize your app to hit the API less. Check this out => (https://github.com/codeforamerica/ohana-api/wiki/Customizing-the-geocoding-configuration) – Cyzanfar Oct 27 '17 at 18:48
  • Thanks, this work! But i need change => REDIS = Redis.connect(url: ENV['REDISTOGO_URL']) To =>REDIS = Redis.new(url: ENV['REDISTOGO_URL']) – Léo Rocha Oct 28 '17 at 21:07
  • 1
    Awesome happy to help. – Cyzanfar Oct 28 '17 at 21:10

1 Answers1

0

The limit is frequently by IP. Are you running your app on shared infrastructure (such as Heroku)? You could also try geocoding client-side, which uses the user's IP as opposed to your server's.

srt32
  • 1,260
  • 1
  • 14
  • 27
  • My app is in development, i trying test this in localhost. – Léo Rocha Oct 27 '17 at 18:40
  • locally don't save lat and long. I receive message:" Google API error: over query limit" in my first query of day – Léo Rocha Oct 27 '17 at 18:45
  • @srt32 there is no shared server locally. Also on Heroku you don't share IP address on the shared server. – Cyzanfar Oct 27 '17 at 18:50
  • @Cyzanfar sure they do. Check out https://devcenter.heroku.com/articles/quotaguard, which explicitly mentions the geocoding use case – srt32 Oct 27 '17 at 22:01
  • @LéoRocha are you on some non-personal local IP address? For example, are you in a coffee shop in a city or using a VPN? If you are, other usage of the geocoding API could be counting against your limit if your IP is not unique to you. – srt32 Oct 27 '17 at 22:02
  • @srt32 I'm home, i think that doesnt the problem – Léo Rocha Oct 28 '17 at 01:03
  • @LéoRocha did you figure out your issue? Are you using an API key? – srt32 Nov 02 '17 at 18:45