This guide walks you through detecting VPN, proxy, TOR, and bot IP addresses in Python using the Focsec API.
By the end, you'll be able to check any IP address and determine whether it's hiding behind a VPN service, proxy server, or the TOR network.
Install the requests library
We'll use the requests library to make HTTP calls to the Focsec API. Install it with pip:
Check an IP for VPN or proxy
Here's a simple example that checks if an IP address is using a VPN or proxy.
Don't have an API key yet? Sign up for free to get one.
API Response
The API returns detection flags for VPN, proxy, TOR, and bots, plus geolocation details:
Detect suspicious IPs
Create a function to check if an IP is using any anonymization method:
Next steps
You're ready to detect VPN and proxy IPs in your Python application. Check the API Reference for all available response fields and error codes.
Sign up for a free account and start detecting VPNs, proxies, and bots in your application.
Get your API key »