Description Usage Arguments Details Value Author(s) See Also Examples
geocodes an IP address using either freegeoip.net http://freegeoip.net or ipinfo.io http://ipinfo.io/developers IP lookup API.
1 |
ip |
a character vector specifying an IP (e.g., "12.215.42.19"). The default value is no IP is specified and the host IP is used. |
api |
use freegeoip.net or ipinfo.io IP lookup API. By default freegeoip.net is used. |
note that freegeoip.net API is allowed up to 10,000 queries per hour by default, ipinfo API is limited to 1,000 requests per day.
a vector with information of ip, country_code, country_name, region_code, city, zip_code, time_zone, latitude, longitude and metro_code for freegeoip.net API, of ip, hostname, city, region, country, loc, org, postal and phone for ipinfo.io IP lookup API. If numerous IPs are input, a data.frame is returned.
Jun Cai (cai-j12@mails.tsinghua.edu.cn), PhD candidate from Department of Earth System Science, Tsinghua University
freegeoip.net IP lookup API at http://freegeoip.net
ipinfo.io IP lookup API at http://ipinfo.io/developers
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
# geocode host IP
geohost()
geohost(api = "ipinfo.io")
# specify an IP for geocoding
geohost(ip = "12.215.42.19")
geohost(ip = "12.215.42.19", api = "ipinfo.io")
# 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.io")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.