VPN Detection API

Know when a visitor is hiding behind a commercial VPN, with one API call.

What counts as a VPN

When someone connects through a commercial VPN service, your site sees the VPN server’s address instead of theirs. People use this to get around bans, create extra accounts, hide where they really are, or get around regional pricing and licensing.

VPN Blocker knows which networks belong to VPN providers. Look up an IP and the answer’s categories contains vpn when it belongs to one, together with a confidence score and the name of the network’s owner.

Get a free API key Read the docs

GET https://api.vpnblocker.net/v2/json/185.213.154.68
{
    "status": "success",
    "package": "Professional",
    "remaining_requests": 987653,
    "ipaddress": "185.213.154.68",
    "host-ip": true,
    "categories": ["vpn"],
    "confidence": 90,
    "hostname": "185.213.154.68",
    "org": "31173 Services AB",
    "country": {
        "name": "Sweden",
        "code": "SE"
    },
    "subdivision": {
        "name": "Västra Götaland County",
        "code": "O"
    },
    "city": "Gothenburg",
    "postal": "415 02",
    "location": {
        "lat": 57.7065,
        "long": 11.967
    }
}

How to check for a VPN

Block or challenge the visitor when categories contains vpn. Add confidence ≥ 90 if you only want to act when we’re sure.

JavaScript

const r = await lookup(ip); // see the guides for lookup()
const isVpn = r !== null && r.categories.includes('vpn') && r.confidence >= 90;

PHP

$r = vpnblocker_lookup($ip); // see the guides for vpnblocker_lookup()
$isVpn = $r !== null && in_array('vpn', $r['categories'], true) && $r['confidence'] >= 90;

Python

r = lookup(ip)  # see the guides for lookup()
is_vpn = r is not None and "vpn" in r["categories"] and r["confidence"] >= 90

Full walkthroughs: PHP · Node.js · Python · game servers and Discord

Why sites block VPNs

Ban evasion

Banned users come straight back on a new address. Blocking VPNs makes a ban stick.

Fake and duplicate accounts

One person can sign up again and again by switching VPN servers to claim trials, referrals or votes.

Payment fraud

Card fraud often comes from VPNs. Check before checkout, and compare the IP’s country with the card’s on Professional and up.

Regional rights and pricing

Streaming, licensing and regional prices depend on where users really are, and VPNs are the usual way around them.

Game servers

Stop griefers and cheaters rejoining on a VPN after being kicked or banned.

Surveys and giveaways

Keep one entry per real person.

Questions

Can you detect every VPN?

We detect commercial VPN services, which is what almost everyone who uses a VPN to hide is using. A VPN someone runs on their own cloud server shows up as hosting instead, and a VPN that ends on a home internet connection looks like a normal home user, so no IP-based service can reliably flag it.

Do I need a paid plan for VPN detection?

No. Every plan, including the Free plan with 10,000 lookups a month, returns categories and confidence. Paid plans add more lookups, and Professional and up add hostname and geolocation.

What happens when a VPN provider adds new servers?

We categorize whole networks, not single addresses, so new servers in a VPN provider’s networks are covered as soon as they come online. Our machine learning models also categorize new networks continuously.

Does it work with IPv6?

Yes. You can look up IPv4 and IPv6 addresses.

What if a real user is flagged by mistake?

Report the IP from the dashboard. Reports are free and don’t use up lookups. You can also use confidence to challenge borderline answers with a captcha instead of blocking them.

Start detecting VPNs today

Create a free account and make your first lookup in minutes. 10,000 lookups a month at no charge.