IP Address Geolocation

Connectors to online and offline sources for taking IP addresses and geolocating them to country, city, timezone and other geographic ranges. For individual connectors, see the package index.

Author(s: Oliver Keyes, Drew Schmidt
License: Apache 2.0
Status: Stable
Current release: 1.0.1

Travis-CI Build Status CRAN_Status_Badge downloads

IP geolocation is a powerful tool to have if you're dealing with web data, and there are a couple of R packages that provide access to specific services, such as the legacy rgeoip package or Bob Rudis's ipapi. They're all spread about and have diffing interfaces, styles and requirements.

rgeolocate aims to be a single generalised package for geolocation; if you have a source you'd like to pull from, the goal is that rgeolocate will provide a binding to it. As of the 0.8.0 release, it contains:

  1. A binding to the binary MaxMind databases;
  2. Wrappers around multiple online geolocation services (see the vignette for more)

If you have other bindings you'd like to see, open a request!

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.


For the latest CRAN release:


For the development version:



rgeolocate depends on httr for the bindings to web databases; other than that, just base R! Thanks to the work of Drew Schmidt, rgeolocate includes the underlying binary libraries and their dependencies.


Version 1.0.1

  • Functions registered with R's C API and namespacing system
  • ip2location() documentation clarified
  • R-side functions now automatically generate absolute paths to the database files.
  • Works on GCC 7.1

Version 1.0.0

  • Allow retrieving isp, organization, autonomous system number, and autonomous system organization from MaxMind (with an ISP database).
  • Support for ip2location binaries is provided through the ip2location() function.

Version 0.8.0


  • Using longer delay for requests to ip-api.com due to new API rate limits.

Version 0.7.0


  • Added feature to retrieve city_geoname_id from maxmind databases
  • Unidenfitiable IP addresses will return NAs from maxmind()


  • The vignette, and documentation of the maxmind function, have been improved to make explicit the datasets rgeolocate ships with (#25)
  • MaxMind free datasets updated.
  • Tests have been rebuilt to be tolerant of server-side problems in the case of remote API calls.

Version 0.6.0


  • Internal country DB updated.
  • client_info() and other telize-based functionality deprecated, as they have shut down their public API.

Version 0.5.0


  • freegeoip() is deprecated as the service is too unreliable to be trusted.
  • David Robinson has provided code that allows for the retrieval of longitude and latitude from maxmind databases


  • Changes to the build process should avoid issues on Fedora machines.

Version 0.4.2

  • Vignette naming problem corrected.

Version 0.4.1

  • Bug when asking maxmind for connection information now accidentally fixed;
  • Internal refactor by Drew Schmidt to maxmind-related C++.

Version 0.4.0

NEW FEATURES *rgeolocate now works on Windows thanks to the work of Drew Schmidt.

DEVELOPMENT *libmaxminddb is now included, making the code self-contained. *Unit tests are fixed to avoid unintended external dependencies.

Version 0.3.0


  • maxmind() is now variable - you can pass in single fields, or various permutations of fields, rather than having it geolocate everything all at once.

Version 0.2.0

NEW FEATURES *Support for freegeoip.net *Support for telize.com

DEVELOPMENT *add extern "C" to make the package more easily installable.

Version 0.1.0

Initial release. Support for MaxMind's binary databases, db-ip.com and ip-api.com

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.3.1 by Os Keyes, a year ago

Report a bug at https://github.com/ironholds/rgeolocate/issues

Browse source code at https://github.com/cran/rgeolocate

Authors: Os Keyes [aut, cre] , Drew Schmidt [aut] , David Robinson [ctb] , Chris Davis [ctb] , Bob Rudis [ctb] , Maxmind , Inc. [cph] , Pascal Gloor [cph] , IP2Location.com [cph]

Documentation:   PDF Manual  

Task views: Web Technologies and Services

Apache License (== 2.0) license

Imports Rcpp, httr

Suggests testthat, knitr

Linking to Rcpp

Suggested by webreadr.

See at CRAN