IpLocate 3.1.0

Suggested Alternatives

IPLocateIO.Client

Additional Details

Package IpLocate is deprecated and longer maintained. Use IPLocateIO.Client instead.

dotnet add package IpLocate --version 3.1.0
                    
NuGet\Install-Package IpLocate -Version 3.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IpLocate" Version="3.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IpLocate" Version="3.1.0" />
                    
Directory.Packages.props
<PackageReference Include="IpLocate" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IpLocate --version 3.1.0
                    
#r "nuget: IpLocate, 3.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package IpLocate@3.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IpLocate&version=3.1.0
                    
Install as a Cake Addin
#tool nuget:?package=IpLocate&version=3.1.0
                    
Install as a Cake Tool

IPLocate Geolocation Client for C#

License: MIT

NuGet

A C# client for the IPLocate.io geolocation API. Look up detailed geolocation and threat intelligence data for any IP address:

  • IP geolocation: IP to country, IP to city, IP to region/state, coordinates, timezone, postal code
  • ASN information: Internet service provider, network details, routing information
  • Privacy & threat detection: VPN, proxy, Tor, hosting provider detection
  • Company information: Business details associated with IP addresses - company name, domain, type (ISP/hosting/education/government/business)
  • Abuse contact: Network abuse reporting information
  • Hosting detection: Cloud provider and hosting service detection using our proprietary hosting detection engine

See what information we can provide for your IP address.

Getting started

You can make 1,000 free requests per day with a free account. For higher plans, check out API pricing.

Installation

.NET CLI

dotnet add package IpLocate

Authentication

Get your free API key from IPLocate.io, and pass it to the IPLocateClient constructor:

IPLocateClient client = IpLocateClientFactory.Client("YOUR_API_KEY");

Quick start

using IpLocate;

var client = IpLocateClientFactory.Client("YOUR_API_KEY");
var result = await client.LookupCurrentIpAsync();

Console.WriteLine($"IP: {result.Ip}, Country: {result.Country}");

Dependency Injection

services.AddHttpClient<IPLocateClient>((sp, http) =>
{
	var opts = sp.GetRequiredService<IOptions<MyApiOptions>>();
	http.BaseAddress = new Uri(opts.Value.BaseUrl);
	http.DefaultRequestHeaders.Add("X-Api-Key", opts.Value.ApiKey);
	http.DefaultRequestHeaders.Add("Accept", "application/json");
	http.DefaultRequestHeaders.Add("User-Agent", "IPLocateClient-OkHttp/1.0.0");
});

API reference

For complete API documentation, visit iplocate.io/docs.

License

This project is licensed under the MIT License - see the LICENSE file for details

Testing

To run tests for this C# library:

dotnet test
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.