This is not the official repo.
You can get rid of dirty data, at least to some extent, with the IsCrawler property. You must send crawler names from appsettings.json in the following format.
"CheckCrawlers": {
"Enable": true,
"Names": [ "google" ]
}
You must also send the configuration (an implementation of IConfiguration) along with your API token.
string token = "MY_TOKEN";
IPinfoClient client = new IPinfoClient.Builder()
.AccessToken(token, configuration)
.Build();

This is the forked repo from official C# .NET SDK for the IPinfo.io IP address API, allowing you to look up your own IP address, or get any of the following details for other IP addresses:
- IP geolocation (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 signing 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-Custom
Install using the dotnet CLI
dotnet add package IPinfo-Custom
Install with NuGet.exe
nuget install IPinfo-Custom
Quick Start
using IPinfo;
using IPinfo.Models;
string token = "MY_TOKEN";
IPinfoClient client = new IPinfoClient.Builder()
.AccessToken(token)
.Build();
Usage
string ip = "216.239.36.21";
IPResponse ipResponse = await client.IPApi.GetDetailsAsync(ip);
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
string ip = "216.239.36.21";
IPResponse ipResponse = client.IPApi.GetDetails(ip);
Country Name Lookup
ipResponse.CountryName will return the country name, whereas ipResponse.Country can be used to fetch the country code.
Additionally ipResponse.IsEU will return true if the country is a member of the European Union (EU), response.CountryFlag
will return the emoji and Unicode of the country's flag, response.CountryCurrency will return the code and symbol of the country's currency
,and response.Continent will return the code and name of the continent. response.CountryFlagURL will return a public link to the country's flag image as an SVG which can be used anywhere.
string ip = "1.1.1.1";
IPResponse ipResponse = await client.IPApi.GetDetailsAsync(ip);
Console.WriteLine($"IPResponse.Country: {ipResponse.Country}");
Console.WriteLine($"IPResponse.CountryName: {ipResponse.CountryName}");
Console.WriteLine($"IPResponse.isEU: {ipResponse.isEU}");
Console.WriteLine($"IPResponse.CountryFlag.Emoji: {ipResponse.CountryFlag.Emoji}");
Console.WriteLine($"IPResponse.CountryFlagurl: {ipResponse.CountryFlagURL}");
Console.WriteLine($"IPResponse.CountryFlag.Unicode: {ipResponse.CountryFlag.Unicode}");
Console.WriteLine($"IPResponse.CountryCurrency.Code: {ipResponse.CountryCurrency.Code}");
Console.WriteLine($"IPResponse.CountryCurrency.Symbol: {ipResponse.CountryCurrency.Symbol}");
Console.WriteLine($"IPResponse.Continent.Code: {ipResponse.Continent.Code}");
Console.WriteLine($"IPResponse.Continent.Name: {ipResponse.Continent.Name}");
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
using IPinfo;
using IPinfo.Cache;
long cacheEntryTimeToLiveInSeconds = 2*60*60*24;
int cacheSizeMbs = 2;
IPinfoClient client = new IPinfoClient.Builder()
.AccessToken(token)
.Cache(new CacheWrapper(cacheConfig => cacheConfig
.CacheMaxMbs(cacheSizeMbs)
.CacheTtl(cacheEntryTimeToLiveInSeconds)))
.Build();
Bogon Filtering
The Bogon property of the IPResponse object can be used to check if an IP address is a bogon.
using IPinfo;
using IPinfo.Models;
string ip = "127.0.0.1";
IPResponse ipResponse = await client.IPApi.GetDetailsAsync(ip);
if (ipResponse.Bogon)
{
Console.WriteLine($"{ipResponse.IP} is a bogon.");
}
else
{
Console.WriteLine($"IPResponse.IP: {ipResponse.IP}");
Console.WriteLine($"IPResponse.City: {ipResponse.City}");
Console.WriteLine($"IPResponse.CountryName: {ipResponse.CountryName}");
}
Thread Safety
This library is thread safe when using default components.
If you decide to replace the cache implementation with your own, you must guarantee thread safety within that library in regard to cache manipulations.
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.
