IPinfo 2.0.0

IPinfo IPinfo C# .NET SDK

License NuGet

This is the official C# .NET SDK for the IPinfo.io IP address API, allowing you to lookup your own IP address, or get any of the following details for other IP addresses:

  • IP geolocation / geoIP data (city, region, country, postal code, latitude and longitude)
  • ASN details (ISP or network operator, associated domain name, and type, such as business, hosting or company)
  • Firmographics data (the name and domain of the business that uses the IP address)
  • Carrier information (the name of the mobile carrier and MNC and MCC for that carrier if the IP is used exclusively for mobile traffic)

Getting Started

You'll need an IPinfo API access token, which you can get by singing up for a free account at https://ipinfo.io/signup.

The free plan is limited to 50,000 requests per month, and doesn't include some of the data fields such as IP type and company data. To enable all the data fields and additional request volumes see https://ipinfo.io/pricing

Installation

This package can be installed from NuGet.

Install using Package Manager
Install-Package IPinfo
Install using the dotnet CLI
dotnet add package IPinfo
Install with NuGet.exe
nuget install IPinfo

Quick Start

// namespace
using IPinfo;
// initializing IPinfo client
string token = "your_token_string";
IPinfoClient client = new IPinfoClient.Builder()
    .AccessToken(token)
    .Build();

Usage

// making API call
string ip = "216.239.36.21";
IPResponse ipResponse = await client.IPApi.GetDetailsAsync(ip);
// accessing location details from response
Console.WriteLine($"IPResponse.IP: {ipResponse.IP}");
Console.WriteLine($"IPResponse.City: {ipResponse.City}");
Console.WriteLine($"IPResponse.Company.Name: {ipResponse.Company.Name}");
Console.WriteLine($"IPResponse.Country: {ipResponse.Country}");
Console.WriteLine($"IPResponse.CountryName: {ipResponse.CountryName}");

Synchronous

// making synchronous API call
string ip = "216.239.36.21";
IPResponse ipResponse = client.IPApi.GetDetails(ip);

Caching

In-memory caching of data is provided by default. Custom implementation of the cache can also be provided by implementing the ICache interface.

Modifying cache options

long cacheEntryTimeToLiveInSeconds = 2*60*60*24; // 2 days
int cacheSizeMbs = 2;
IPinfoClient client = new IPinfoClient.Builder()
    .AccessToken(token) // pass your token string
    .Cache(new CacheWrapper(cacheConfig => cacheConfig
        .CacheMaxMbs(cacheSizeMbs) // pass cache size in mbs
        .CacheTtl(cacheEntryTimeToLiveInSeconds))) // pass time to live in seconds for cache entry
    .Build();

Samples

Sample codes are also available.

Other Libraries

There are official IPinfo client libraries available for many languages including PHP, Go, Java, Ruby, and many popular frameworks such as Django, Rails and Laravel. There are also many third party libraries and integrations available for our API.

About IPinfo

Founded in 2013, IPinfo prides itself on being the most reliable, accurate, and in-depth source of IP address data available anywhere. We process terabytes of data to produce our custom IP geolocation, company, carrier, VPN detection, hosted domains, and IP type data sets. Our API handles over 40 billion requests a month for 100,000 businesses and developers.

image

No packages depend on IPinfo.

Latest IPinfo C# SDK with caching and clearer API.

.NET Standard 2.0

Version Downloads Last updated
3.3.0 0 01/22/2026
3.2.0 2 12/16/2025
3.1.1 2 12/16/2025
3.1.0 1 12/16/2025
3.0.1 2 12/16/2025
3.0.0 2 12/16/2025
2.1.0 1 12/16/2025
2.0.2 1 12/16/2025
2.0.1 2 12/16/2025
2.0.0 2 12/16/2025
1.1.14 2 12/14/2025
1.1.13 2 12/14/2025
1.1.12 2 12/14/2025
1.1.11 2 12/15/2025
1.1.9 2 12/16/2025
1.1.8 2 12/16/2025
1.1.4 2 12/16/2025
1.1.3 1 12/16/2025
1.1.1 3 12/16/2025
1.0.5.4 2 12/17/2025
1.0.5.3 2 12/17/2025
1.0.5.2 2 12/17/2025
1.0.5.1 3 12/09/2025
1.0.5 2 12/16/2025
1.0.4.2 2 12/17/2025
1.0.4.1 2 12/17/2025
1.0.4 2 12/16/2025
1.0.3 3 12/16/2025
1.0.2 2 12/16/2025
1.0.1 2 12/16/2025
1.0.0 2 12/16/2025
1.0.0-beta.4 2 12/17/2025
1.0.0-beta.3 2 12/17/2025
1.0.0-beta.2 2 12/17/2025
1.0.0-beta.1 2 12/17/2025