ipdata.co is a fast, reliable and clean service that allows you to look up the location of an IP Address and other data.
Branch | Platform | Status | Coverage |
---|---|---|---|
Master | Linux\Windows\macOS | ||
Develop | Linux\Windows\macOS |
NuGet package install using package manager:
Install-Package IpData -Version 1.1.0
NuGet package install using .NET CLI:
dotnet add package IpData --version 1.1.0
All usage examples you can find on samples
folder.
var client = new IpDataClient("API_KEY");
// Get ip data from my ip
var myIpInfo = await client.Lookup();
Console.WriteLine($"Country name for {myIpInfo.Ip} is {myIpInfo.CountryName}");
// Get localized ip data from my ip
var myIpInfoLocalized = await client.Lookup(CultureInfo.GetCultureInfo("zh-CN"));
Console.WriteLine($"Localized country name for {myIpInfoLocalized.Ip} is {myIpInfoLocalized.CountryName}");
// Get ip data from ip
var ipInfo = await client.Lookup("8.8.8.8");
Console.WriteLine($"Country name for {ipInfo.Ip} is {ipInfo.CountryName}");
// Get localized ip data from ip
var ipInfoLocalized = await client.Lookup("8.8.8.8", CultureInfo.GetCultureInfo("zh-CN"));
Console.WriteLine($"Localized country name for {myIpInfoLocalized.Ip} is {ipInfoLocalized.CountryName}");
// Get single field from ip
var countryName = await client.Lookup("8.8.8.8", x => x.CountryName);
Console.WriteLine($"Country name for 8.8.8.8 is {countryName}");
From ipdata.co docs:
Note that bulk lookups are only available to paid users and are currently limited to a 100 at a time. Reach out to support if you need to lookup larger batches.
var client = new IpDataClient("API_KEY");
var ipInfoList = await client.Lookup(new string[] { "1.1.1.1", "2.2.2.2", "3.3.3.3" });
foreach (var ipInfo in ipInfoList)
{
Console.WriteLine($"Country name for {ipInfo.Ip} is {ipInfo.CountryName}");
}
var client = new IpDataClient("API_KEY");
var carrierInfo = await client.Carrier("69.78.70.144");
Console.WriteLine($"Carrier name: {carrierInfo.Name}");
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License - see the LICENSE.md file for details