Preventing Free Trial Abuse

IpForensics might be used to protect your app from trial abuse or from users trying to get around country restrictions by using Tor or proxies.

Below is a Javascript code snippet that could be used to forbid account creation to anonymous users (i.e. users detected as using Tor, a proxy, or a VPN):

// Getting the anonymity status from the user's IP
$.get("https://ipforensics.net/api/v1/origin?apikey=APIKEY", function (response) {
  if (response.meta_data.threat_detector.is_anonymous || response.meta_data.threat_detector.is_vpn || response.meta_data.threat_detector.is_tor || ...) {
    alert("You are not allowed to create an account.");
    }
}, "jsonp");

You can chain multiple checks

response.meta_data.threat_detector.is_anonymous || response.meta_data.threat_detector.is_vpn || response.meta_data.threat_detector.is_tor || ...

IpForensics also offers the option of blocking users whose IP's have been reported repeatedly by admins across the Internet for malicious activity or spam. For this purpose, you can respectively use the fields is_attacker and is_abuser.

Always reference the API endpoint for complete response result

Last updated