YotpoLtd / geoip2

Integration with Maxmind GeoIP2 API
GNU General Public License v2.0
27 stars 18 forks source link

Is it possible to get lat/lon ? #8

Open abrambailey opened 10 years ago

abrambailey commented 10 years ago

I'd like to get lat/lon, or even just the full json array from MaxMind.. is this possible?

Geoip2.location('70.112.225.219')
NoMethodError: undefined method `location' for Geoip2:Module

http://dev.maxmind.com/geoip/geoip2/web-services/#location

nafmarcus commented 10 years ago

Took some trial and error. This is a paid service. There are 3 options: Country, City, Insights. See https://www.maxmind.com/en/geoip2-precision-services

Therefore, this gem allows Geoip2.country(ip-address) or Geoip2.city(ip-address) or Geoip2.insights(ip-address). Each one returns a hash with all the info.

In order to get lat-long you have to purchase the city or insights service.