Preventing Free Trial Abuse

Ipregistry 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):

fetch('https://api.ipregistry.co/?key=YOUR_API_KEY')
.then(function (response) { return response.json(); })
.then(function (payload) {
    const isAnonymous = payload['security']['is_anonymous'];
    if (isAnonymous) {
        // Prevent user to sign up or require a credit card
    }
});

You might also choose to allow Tor users through and only block users using VPNs:

fetch('https://api.ipregistry.co/?key=YOUR_API_KEY')
.then(function (response) { return response.json(); })
.then(function (payload) {
    const isVpn = payload['security']['is_vpn'];
    if (isVpn) {
        // Prevent user to sign up or require a credit card
    }
});

Ipregistry 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.