This guide walks you through detecting VPN, proxy, TOR, and bot IP addresses in C# using HttpClient and the Focsec API.
The examples use modern async/await patterns and work with .NET 6+ and ASP.NET Core applications.
1
Create the response model
Define a class to deserialize the API response:
2
Check an IP for VPN or proxy
Use HttpClient to call the Focsec API.
Get your free API key to start detecting VPNs.
API Response
The API returns detection flags and location data as JSON:
3
ASP.NET Core middleware
Create middleware to block VPN users from sensitive endpoints:
Next steps
You've integrated VPN detection into your C# application. See the API Reference for all available fields and options.
Ready to get started?
Sign up for a free account and start detecting VPNs, proxies, and bots in your application.
Get your API key »