0

I have a model Events with geocoded_by :address and after_validation :geocode, I also have a google api key in my geocoder.rb (initializer). The key is enabled for GeocodingAPi. When I run .geocode in console I have a limit error message.

2.5.3 :024 > Geocoder.coordinates("25 Main St, Cooperstown, NY")
Google API error: over query limit.

or

2.5.3 :030 > a.full_address
 => "80,  Rue des Capucins, Paris" 
2.5.3 :031 > a.geocode
Google API error: over query limit.
 => nil 
2.5.3 :032 > 

I have not used that API at all today, so I am sure this cannot be a limit issue. I am testing on localhost, so cannot be a shared server limit issue either. Anybody know what should be done/checked in such case ?

Geocoder.configure(
   lookup: :google,            
   ip_lookup: :ipinfo_io,      
   use_https: true,           
   api_key: nil,               
   cache: Redis.new,                 
  api_key: 'AIzaSXXXXXXXXXXXXXXXXXXXXXXXXXX'

)
Rene Chan
  • 864
  • 1
  • 11
  • 25

1 Answers1

1

Google Geolocation API is not free, it has limit. check the website gecoding usage

  • In case someone else look for it for hours, this is the link to go quick: https://console.cloud.google.com/project/_/billing/enable?redirect=https://developers.google.com/maps/documentation/geocoding/usage-and-billing?dialogOnLoad%3Dbilling-enabled&_ga=2.45638692.1407938638.1547003953-2127324926.1547003953 – Rene Chan Jan 09 '19 at 23:13