ip_info: Geolocate IP Addresses Through ipinfo.io

Description Usage Arguments Value See Also Examples

View source: R/ipinfo.R

Description

ip_info consumes a vector of IP addresses and geolocates them via ipinfo.io.

Usage

1
ip_info(ip_addresses, token = NULL)

Arguments

ip_addresses

a character vector of IP addresses

token

optionally, an API token. If you don't use one, you can still use the system, but requests will be capped to 1,000 a day.

Value

either a data.frame containing the geolocated information. If an IP cannot be geolocated, or values are not available, the fields will be filled with NA values.

See Also

ip_api and db_ip for other online geolocation APIs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
#Valid, data.frame output
result <- ip_info("2607:FB90:426:DC1D:CFC4:4875:8BC2:4D93")

#Invalid, data.frame output
result <- ip_info("argh")

#Valid list output
result <- ip_info("2607:FB90:426:DC1D:CFC4:4875:8BC2:4D93", as_data_frame = FALSE)

#Invalid list output
result <- ip_info("argh", as_data_frame = FALSE)

## End(Not run)

rgeolocate documentation built on Dec. 20, 2021, 9:06 a.m.