This guide explains how to detect VPN, proxy, TOR, and bot IP addresses in Java using the built-in HttpClient (Java 11+) and the Focsec API.
You'll learn to query any IP address and check whether it's masked by a VPN, proxy, or TOR connection.
Create the response class
Define a class to hold the API response. We'll use Jackson for JSON parsing:
Check an IP for VPN or proxy
Use Java's HttpClient to query the Focsec API.
Register for a free API key to get started.
API Response
The API returns a JSON object containing threat detection flags and location data:
Detect suspicious IPs
Use the isSuspicious() method to flag anonymous connections:
Next steps
You're now ready to detect VPN and proxy IPs in Java. Browse the API Reference for detailed documentation on all response fields.
Sign up for a free account and start detecting VPNs, proxies, and bots in your application.
Get your API key »