Description Usage Arguments Details Value Author(s) References See Also Examples
geocodes an IP address using either ipify.org (https://www.ipify.org), ipstack.com (https://ipstack.com) or ipinfo.io (http://ipinfo.io/developers) IP lookup API.
1 2 3 |
ip |
a character vector specifying IPs (IPv4 or IPv6) (e.g., "12.215.42.19"). The default value is no IP is specified and the host IP is used. |
api |
use 'ipify' (ipify.org), 'ipstack' (ipstack.com) or 'ipinfo'(ipinfo.io) lookup API. By default 'ipinfo' is used. |
output |
character, 'country', 'region', 'city', 'all' or 'raw'. It decides which columns to return in the output data.frame.
|
use_curl |
logical, whether use curl to access the APIs. Default FALSE. |
time |
numeric, time interval to lookup the IP address, by seconds. It is used to avoid overuse of the APIs. Default 0. |
key |
character, the api key for ipinfo or ipstack. Default NULL, which indicates that the function will try to find it in cache. When no match is found, a GUI wizard will be launched for you to enter the key. If the API does not call for a key, set it to NA. |
note that ipstack.com API is allowed up to 10,000 queries per month by default, ipinfo API is limited to 1,000 requests per day, and ipify.org API is limited to 1,000 requests per month.
a data.frame.
Jun Cai (cai-j12@mails.tsinghua.edu.cn), PhD student from
Center for Earth System Science, Tsinghua University
Yiying Wang (wangy@aetna.com)
ipipy.org IP lookup API at https://www.ipify.org
ipstack.com IP lookup API at https://ipstack.com/documentation
ipinfo.io IP lookup API at https://ipinfo.io/developers
geocode
, revgeocode
, parse_geohosts
.
synthesize_ipinfo_api()
, synthesize_ipify_api()
,
synthesize_ipstack_api()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
# geocode host IP
geohost()
geohost(api = "ipinfo")
# specify an IP for geocoding
geohost(ip = "12.215.42.19")
geohost(ip = "12.215.42.19", api = "ipinfo")
# geocode multiple IPs
geohost(ip = c("61.135.169.81", "12.215.42.19"))
geohost(ip = c("61.135.169.81", "12.215.42.19"), api = "ipinfo")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.