This tutorial shows you how to detect VPN, proxy, TOR, and bot IP addresses in Node.js using the built-in fetch API (Node.js 18+) and the Focsec API.
You'll also learn how to implement VPN detection as Express.js middleware to protect sensitive routes.
Check an IP for VPN or proxy
Make an API request to detect VPN and proxy IPs.
No API key? Get one for free in seconds.
API Response
The response includes boolean flags for each threat type and geolocation data:
Detect suspicious IPs
Create a helper function to flag VPN, proxy, TOR, or bot connections:
Express.js middleware
Protect checkout and other sensitive routes by blocking VPN and proxy users:
Next steps
You've successfully added VPN detection to your Node.js app. See the API Reference for additional response fields and options.
Sign up for a free account and start detecting VPNs, proxies, and bots in your application.
Get your API key »