IpRegistry 1.0.1

dotnet add package IpRegistry --version 1.0.1                
NuGet\Install-Package IpRegistry -Version 1.0.1                
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="IpRegistry" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IpRegistry --version 1.0.1                
#r "nuget: IpRegistry, 1.0.1"                
#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.
// Install IpRegistry as a Cake Addin
#addin nuget:?package=IpRegistry&version=1.0.1

// Install IpRegistry as a Cake Tool
#tool nuget:?package=IpRegistry&version=1.0.1                

IpRegistry

.NET wrapper to query the IpRegistry API for IP address data.

Installation

To use IpRegistry in your C# project, you can either download the IpRegistry C# .NET libraries directly from the Github repository or, if you have the NuGet package manager installed, you can grab them automatically.

PM> Install-Package IpRegistry

Once you have the IpRegistry libraries properly referenced in your project, you can include calls to them in your code.

Add the following namespaces to use the library:

using IpRegistry.Models;
using IpRegistry.Services;

Usage

The client is intended to be used via Dependency Injection and added using the IpRegistry extension.

// Add API client
serviceCollection.AddIpRegistry(options =>
    {
        options.ApiKey = "API KEY";
    });

// Or load from appsettings.json
serviceCollection.AddIpRegistry(configuration.GetSection("IpRegistry"));

An instance of the service can also be created directly if required.

var service = new IpRegistryService(
    new Models.Options.IpRegistryOptions()
    {
        ApiKey = "API KEY"
    });

The client can then be used as expected.

var ipMyAddressDetails = await _ipRegistryService.GetIpAddressDetailsAsync();

var ipTargetAddressDetails = await _ipRegistryService.GetIpAddressDetailsAsync("66.165.2.7");

var ipTargetBatchAddressDetails = await _ipRegistryService.GetIpAddressDetailsAsync(new List<string>()
{
    "66.165.2.7", "2a01:e35:2f22:e3d0::2", "1.1.1.1"
});

var myUserAgentDetails = await _ipRegistryService.GetUserAgentDetailsAsync();

var targetUserAgentDetails = await _ipRegistryService.GetUserAgentDetailsAsync("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0");

var targetUserAgentBatchDetails = await _ipRegistryService.GetUserAgentDetailsAsync(new List<string>()
{
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36"
});

Documentation for the API can be found on the Ipregistry site.

See the debug project for an example.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
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.

Version Downloads Last updated
1.0.1 356 3/23/2022
1.0.0 221 3/23/2022

Creation