Skip to content

C# SDK

GitHub

The IPWho C# SDK wraps the IP geolocation API in idiomatic .NET — typed POCO responses, async/await support, and a single NuGet reference. One call returns the full payload: geolocation, timezone, currency, connection (ASN/ISP), security flags, and more.

Targets .NET 8. Namespace: IPWho. Client: IpWhoClient.

When NuGet is live:

Terminal window
dotnet add package IPWho.Sdk

Until then, clone the GitHub repo and add a project reference to IPWho.Sdk.csproj.

using IPWho;
var client = new IpWhoClient(Environment.GetEnvironmentVariable("IPWHO_API_KEY")!);
var resp = await client.LookupAsync("8.8.8.8"); // GET /ip/{ip}
var me = await client.MeAsync(); // GET /me
var bulk = await client.BulkAsync(new List<string> { "8.8.8.8", "1.1.1.1" });
try
{
var resp = await client.LookupAsync("8.8.8.8");
}
catch (InvalidIPException)
{
// malformed IP address (404)
}
catch (RateLimitException)
{
// plan limit reached (429)
}
catch (APIResponseException)
{
// unexpected response
}
  • LookupAsync(string ip) — GET /ip/{ip}
  • MeAsync() — GET /me
  • BulkAsync(List<string> ips) — GET /bulk/{a,b,c}