Geo IP lookup service
A library for searching Location information (country, city, region) by IP.
Location location = lookupService.getLocation("217.71.44.212");
assertEquals("EE", location.countryCode);
assertEquals("Estonia", location.countryName);
assertEquals("Tallinn", location.city);
assertEquals("01", location.region);
assertEquals(59.4339, location.latitude, 0.0001);
assertEquals(24.728104, location.longitude, 0.000001);
Download the latest jar from central Maven repository:
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>geoip</artifactId>
<version>1.4</version>
</dependency>
To upload a newer version to Maven central repo:
- Update version number in build.gradle
- Run
./gradlew -b deploy.gradle --info
- Login to https://oss.sonatype.org/#stagingRepositories and go through standard flow (Artifact -> Close -> Release)
We use the file downloaded from http://dev.maxmind.com/geoip/legacy/geolite/
Many thanks to these incredible tools that help us creating open-source software:
geo-ip is open-source project and distributed under MIT license
This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com.