Learn R Programming

rIP (version 1.2.0)

getIPinfo: Detects Fraud in Online Surveys by Tracing, Scoring, and Visualizing IP Addresses

Description

Cleans and processes an array of IP address data and, using keys for several IP check services, passes these data to the needed APIs. Returns visual and numerical information on the IP address, including the internet service provider (ISP) and whether it is likely a server farm being used to disguise a respondent's location.

Usage

getIPinfo(d, "i", "iphub_key", "ipintel_key", "proxycheck_key", plots = TRUE)

Arguments

d

Data frame where IP addresses are stored

i

Name of the vector in data frame, d, corresponding to IP addresses in quotation marks

iphub_key

User's IP Hub X-key in quotation marks

ipintel_key

User's email address (used as key for getipintel.net) in quotation marks

proxycheck_key

User's API key for proxycheck.io in quotation marks

plots

Logical argument. If TRUE, produces a barplot of potentially suspicious IP addresses. Default is TRUE.

Value

ipDF A dataframe with the IP address, country code, country name, asn, isp, block, and hostname.

Details

Takes an array of IPs and the keys for the services the user wishes to use (IP Hub, IP Intel, and Proxycheck), and passes these to all respective APIs. Returns a dataframe with the IP addresses (used for merging), country, ISP, labels for non-US IP Addresses, VPS use, and recommendations for blocking. The function also provides optional visualization tools for checking the distributions.

Examples

Run this code
# NOT RUN {
ip_hub_key <- "MzI2MTpkOVpld3pZTVg1VmdTV3ZPenpzMmhopIMkRMZQ=="
ipintel_key <- "useremailaddress"
proxycheck_key <- "MzI2MTpkOVpld3pZTVg1VmdTV3ZPenpzMmhod"
ipsample <- data.frame(rbind(c(1, "189.8.105.146"), c(2, "148.233.134.248")))
names(ipsample) <- c("number", "IPAddress")
getIPinfo(ipsample, "IPAddress", ip_hub_key, ipintel_key, proxycheck_key)
# }

Run the code above in your browser using DataLab