APIVerve.API.VPNProxyDetector
1.1.10
dotnet add package APIVerve.API.VPNProxyDetector --version 1.1.10
NuGet\Install-Package APIVerve.API.VPNProxyDetector -Version 1.1.10
<PackageReference Include="APIVerve.API.VPNProxyDetector" Version="1.1.10" />
<PackageVersion Include="APIVerve.API.VPNProxyDetector" Version="1.1.10" />
<PackageReference Include="APIVerve.API.VPNProxyDetector" />
paket add APIVerve.API.VPNProxyDetector --version 1.1.10
#r "nuget: APIVerve.API.VPNProxyDetector, 1.1.10"
#:package APIVerve.API.VPNProxyDetector@1.1.10
#addin nuget:?package=APIVerve.API.VPNProxyDetector&version=1.1.10
#tool nuget:?package=APIVerve.API.VPNProxyDetector&version=1.1.10
APIVerve.API.VPNProxyDetector API
VPN Detector is a simple tool for detecting VPN usage. It returns a boolean value indicating whether the IP address is using a VPN or not.
This is a .NET Wrapper for the APIVerve.API.VPNProxyDetector API
Installation
Using the .NET CLI:
dotnet add package APIVerve.API.VPNProxyDetector
Using the Package Manager:
nuget install APIVerve.API.VPNProxyDetector
Using the Package Manager Console:
Install-Package APIVerve.API.VPNProxyDetector
From within Visual Studio:
- Open the Solution Explorer
- Right-click on a project within your solution
- Click on Manage NuGet Packages
- Click on the Browse tab and search for "APIVerve.API.VPNProxyDetector"
- Click on the APIVerve.API.VPNProxyDetector package, select the appropriate version in the right-tab and click Install
Configuration
Before using the vpndetector API client, you have to setup your account and obtain your API Key. You can get it by signing up at https://apiverve.com
Quick Start
Here's a simple example to get you started quickly:
using System;
using APIVerve;
class Program
{
static async Task Main(string[] args)
{
// Initialize the API client
var apiClient = new VPNProxyDetectorAPIClient("[YOUR_API_KEY]");
var queryOptions = new VPNProxyDetectorQueryOptions {
ip = "103.62.49.210"
};
// Make the API call
try
{
var response = await apiClient.ExecuteAsync(queryOptions);
if (response.Error != null)
{
Console.WriteLine($"API Error: {response.Error}");
}
else
{
Console.WriteLine("Success!");
// Access response data using the strongly-typed ResponseObj properties
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(response, Newtonsoft.Json.Formatting.Indented));
}
}
catch (Exception ex)
{
Console.WriteLine($"Exception: {ex.Message}");
}
}
}
Usage
The APIVerve.API.VPNProxyDetector API documentation is found here: https://docs.apiverve.com/ref/vpndetector. You can find parameters, example responses, and status codes documented here.
Setup
Authentication
APIVerve.API.VPNProxyDetector API uses API Key-based authentication. When you create an instance of the API client, you can pass your API Key as a parameter.
// Create an instance of the API client
var apiClient = new VPNProxyDetectorAPIClient("[YOUR_API_KEY]");
Usage Examples
Basic Usage (Async/Await Pattern - Recommended)
The modern async/await pattern provides the best performance and code readability:
using System;
using System.Threading.Tasks;
using APIVerve;
public class Example
{
public static async Task Main(string[] args)
{
var apiClient = new VPNProxyDetectorAPIClient("[YOUR_API_KEY]");
var queryOptions = new VPNProxyDetectorQueryOptions {
ip = "103.62.49.210"
};
var response = await apiClient.ExecuteAsync(queryOptions);
if (response.Error != null)
{
Console.WriteLine($"Error: {response.Error}");
}
else
{
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(response, Newtonsoft.Json.Formatting.Indented));
}
}
}
Synchronous Usage
If you need to use synchronous code, you can use the Execute method:
using System;
using APIVerve;
public class Example
{
public static void Main(string[] args)
{
var apiClient = new VPNProxyDetectorAPIClient("[YOUR_API_KEY]");
var queryOptions = new VPNProxyDetectorQueryOptions {
ip = "103.62.49.210"
};
var response = apiClient.Execute(queryOptions);
if (response.Error != null)
{
Console.WriteLine($"Error: {response.Error}");
}
else
{
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(response, Newtonsoft.Json.Formatting.Indented));
}
}
}
Error Handling
The API client provides comprehensive error handling. Here are some examples:
Handling API Errors
using System;
using System.Threading.Tasks;
using APIVerve;
public class Example
{
public static async Task Main(string[] args)
{
var apiClient = new VPNProxyDetectorAPIClient("[YOUR_API_KEY]");
var queryOptions = new VPNProxyDetectorQueryOptions {
ip = "103.62.49.210"
};
try
{
var response = await apiClient.ExecuteAsync(queryOptions);
// Check for API-level errors
if (response.Error != null)
{
Console.WriteLine($"API Error: {response.Error}");
Console.WriteLine($"Status: {response.Status}");
return;
}
// Success - use the data
Console.WriteLine("Request successful!");
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(response, Newtonsoft.Json.Formatting.Indented));
}
catch (ArgumentException ex)
{
// Invalid API key or parameters
Console.WriteLine($"Invalid argument: {ex.Message}");
}
catch (System.Net.Http.HttpRequestException ex)
{
// Network or HTTP errors
Console.WriteLine($"Network error: {ex.Message}");
}
catch (Exception ex)
{
// Other errors
Console.WriteLine($"Unexpected error: {ex.Message}");
}
}
}
Comprehensive Error Handling with Retry Logic
using System;
using System.Threading.Tasks;
using APIVerve;
public class Example
{
public static async Task Main(string[] args)
{
var apiClient = new VPNProxyDetectorAPIClient("[YOUR_API_KEY]");
// Configure retry behavior (max 3 retries)
apiClient.SetMaxRetries(3); // Retry up to 3 times (default: 0, max: 3)
apiClient.SetRetryDelay(2000); // Wait 2 seconds between retries
var queryOptions = new VPNProxyDetectorQueryOptions {
ip = "103.62.49.210"
};
try
{
var response = await apiClient.ExecuteAsync(queryOptions);
if (response.Error != null)
{
Console.WriteLine($"API Error: {response.Error}");
}
else
{
Console.WriteLine("Success!");
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(response, Newtonsoft.Json.Formatting.Indented));
}
}
catch (Exception ex)
{
Console.WriteLine($"Failed after retries: {ex.Message}");
}
}
}
Advanced Features
Custom Headers
Add custom headers to your requests:
var apiClient = new VPNProxyDetectorAPIClient("[YOUR_API_KEY]");
// Add custom headers
apiClient.AddCustomHeader("X-Custom-Header", "custom-value");
apiClient.AddCustomHeader("X-Request-ID", Guid.NewGuid().ToString());
var queryOptions = new VPNProxyDetectorQueryOptions {
ip = "103.62.49.210"
};
var response = await apiClient.ExecuteAsync(queryOptions);
// Remove a header
apiClient.RemoveCustomHeader("X-Custom-Header");
// Clear all custom headers
apiClient.ClearCustomHeaders();
Request Logging
Enable logging for debugging:
var apiClient = new VPNProxyDetectorAPIClient("[YOUR_API_KEY]", isDebug: true);
// Or use a custom logger
apiClient.SetLogger(message =>
{
Console.WriteLine($"[LOG] {DateTime.Now:yyyy-MM-dd HH:mm:ss} - {message}");
});
var queryOptions = new VPNProxyDetectorQueryOptions {
ip = "103.62.49.210"
};
var response = await apiClient.ExecuteAsync(queryOptions);
Retry Configuration
Customize retry behavior for failed requests:
var apiClient = new VPNProxyDetectorAPIClient("[YOUR_API_KEY]");
// Set retry options
apiClient.SetMaxRetries(3); // Retry up to 3 times (default: 0, max: 3)
apiClient.SetRetryDelay(1500); // Wait 1.5 seconds between retries (default: 1000ms)
var queryOptions = new VPNProxyDetectorQueryOptions {
ip = "103.62.49.210"
};
var response = await apiClient.ExecuteAsync(queryOptions);
Dispose Pattern
The API client implements IDisposable for proper resource cleanup:
using (var apiClient = new VPNProxyDetectorAPIClient("[YOUR_API_KEY]"))
{
var queryOptions = new VPNProxyDetectorQueryOptions {
ip = "103.62.49.210"
};
var response = await apiClient.ExecuteAsync(queryOptions);
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(response, Newtonsoft.Json.Formatting.Indented));
}
// HttpClient is automatically disposed here
Example Response
{
"status": "ok",
"error": null,
"data": {
"ip": "103.62.49.210",
"is_vpn": false,
"is_datacenter": true,
"checked_on": "2025-02-20",
"risk_level": "High",
"threat_level": "Moderate"
}
}
Customer Support
Need any assistance? Get in touch with Customer Support.
Updates
Stay up to date by following @apiverveHQ on Twitter.
Legal
All usage of the APIVerve website, API, and services is subject to the APIVerve Terms of Service and all legal documents and agreements.
License
Licensed under the The MIT License (MIT)
Copyright (©) 2025 APIVerve, and EvlarSoft LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net20 is compatible. net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 2.0
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 3.5
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.0
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.5
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http (>= 4.3.4)
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http (>= 4.3.4)
-
.NETStandard 2.1
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http (>= 4.3.4)
-
net6.0
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http (>= 4.3.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release of VPNProxyDetector API client. Features include async/await support, automatic retries, custom headers, request logging, and cancellation token support.