Description Usage Arguments Details Examples
MaxMind does a set of proprietary geolocation databases
- they're pretty accurate! maxmind
provides a connector to
MaxMind services.
1 2 3 4 5 |
ips |
a character vector of IP addresses (IPv4 and IPv6 both work) |
file |
the full path to the .mmdb file you want to query. |
fields |
the fields you want to retrieve - a vector of any combination of:
|
geolookup
uses the MaxMind GeoIP2 databases
to geolocate IP addresses, retrieving any of the data listed in fields
. Different fields are
appropriate for different provided files; the connection type databases, for example, contain connection
types and nothing else, while the city- and country-level files don't contain connection types at all.
rgeolocate
ships with a country-level database (accessing it can be seen in the examples). If
you need city-level data, or other MaxMind databases, you'll need to download the .mmdb
files
yourself - for CRAN and/or copyright reasons, depending, we cannot include them.
In the event that the file provided does not have the field you have requested (or the IP address does not have an entry for that field), NA will be returned instead. In the event that the IP address doesn't have an entry in the file at all, NA will be returned for every field.
1 2 3 | # An example, using the country-level dataset shipped with rgeolocate.
file <- system.file("extdata","GeoLite2-Country.mmdb", package = "rgeolocate")
results <- maxmind("196.200.60.51", file, "country_code")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.