IpForensics
HomeGoto Dashboard
  • 📖Introduction
  • Protocols
    • HTTP Json Protocol
    • Response headers
    • Error Codes
  • Features
    • Pay-As-You-Go
    • API Security
    • HTTPS
  • Api Response Data
    • 📶Mobile Carrier
    • 🏥ASN
    • 📊General
    • ⏲️Timezone
    • 💵Currency
    • 👨‍💻Threat Detector
    • 🌐Company
    • 🌏Geolocation
    • 🌍Advance Geolocation
    • 💻Device Information
    • ✈️IATA/ICAO
  • API
    • 🚀Intro
    • 📊IP & Threat Intelligence API
      • Single Lookup
      • Origin Lookup
    • 💹Exchange Rate API
      • Currency Endpoint
      • Live Rate Endpoint
      • Historical Rate Endpoint
      • Currency Conversion Endpoint
      • Currency Swap Endpoint
  • Code Implantation
    • Block Automated Visits From Hosting Providers
    • Block VPN/Proxy and Tor users
    • Redirect by Country and Location Offers
    • Content Personalisation
    • Get the location from an IP Address in Javascript
    • How to get a client's IP address using JavaScript
    • HTML5 Geolocation with IpForensics fallback
    • Blocking Users by Country
    • Detecting Users Currency or Currency Personalisation
    • Preventing Free Trial Abuse
    • Device-Based Ads and App Binary
    • Detect Users Device/Computer and Operating System
    • Detect visitors from EU countries
    • How to detect and prevent credit card fraud
    • How to convert amounts to website visitor currency
  • MISC
    • Changelog
    • FAQs
    • Troubleshooting
    • API Status
    • Rate Limits
Powered by GitBook
On this page

Was this helpful?

  1. Code Implantation

Block VPN/Proxy and Tor users

PreviousBlock Automated Visits From Hosting ProvidersNextRedirect by Country and Location Offers

Last updated 2 years ago

Was this helpful?

This code example shows you how you might protect your app from free trial abuse or from users trying to get around country restrictions by using Tor or Proxies.

// 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) {
    alert("You are not allowed to create an account.");
    }
}, "jsonp");

This simple example shows "You are not allowed to create an account." if is_anonymous is true . You can replace it with more complex handling such as preventing the user from signing up or requiring a credit card. You might also choose to allow Tor users through and only block users using proxies.

// 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_proxy) {
    alert("You are not allowed to create an account.");
    }
}, "jsonp");

You also have the option of blocking users whose IP's have been reported repeatedly by admins across the internet for malicious activity or spam. To do this simply block if the following fields are true;

  • is_known_abuser - to block IPs that have been reported to be sources of spam

  • is_known_attacker - to block IPs that have been reported to be the source of malicious activity

We aggregate and regularly update our lists from high quality, authoritative sources to develop our dataset of more than 600M malicious IP Addresses, spammers, open proxies and Tor exit nodes

Always reference the for complete response result

API endpoint