Skip to content

Unofficial API for whatismyipaddress.com in .NET Standard

License

Notifications You must be signed in to change notification settings

RyuzakiH/WhatIsMyIPAddress-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatIsMyIPAddress-API AppVeyor NuGet

Unofficial API for WhatIsMyIPAddress in .NET Standard

NuGet: https://www.nuget.org/packages/WhatIsMyIPAddress.API

Usage

This API provides synchronous and asynchronous methods

var client = new Client();

// To use a proxy
var client = new Client(new WebProxy("169.57.1.84:8080"));

To get your IP

// Sync
var ip = client.GetMyIPAddress(); // IPv4 by default
var ipv4 = client.GetMyIPAddress(System.Net.Sockets.AddressFamily.InterNetwork);
var ipv6 = client.GetMyIPAddress(System.Net.Sockets.AddressFamily.InterNetworkV6);
// Async
var ip = await client.GetMyIPAddressAsync();
var ipv4 = client.GetMyIPAddressAsync(System.Net.Sockets.AddressFamily.InterNetwork);
var ipv6 = client.GetMyIPAddressAsync(System.Net.Sockets.AddressFamily.InterNetworkV6);

Lookup IP Tool

This tool provides details about an IP address. It's estimated physical location (country, state, and city) and a map.

var details = client.LookupIP(ip);
var details = await client.LookupIPAsync(ip);

Advanced Proxy Check Tool

If you are using a proxy server use this tool to check and see if any information is being exposed.

var proxy = client.ProxyCheck(new WebProxy("138.68.240.218:8080")).IsProxyServer;
// sets timeout to 20 seconds and number of tries (try again if request fails) to 2 [Optional]
var proxy = client.ProxyCheck(new WebProxy("138.68.240.218:8080"), TimeSpan.FromSeconds(20000), 2).IsProxyServer;

var proxy = (await client.ProxyCheckAsync(new WebProxy("138.68.240.218:8080"))).IsProxyServer;

Blacklist Check Tool

This tool will check to see if your IP address is listed with more than 100 DNSbl's as a machine that mail should not be accepted from.

var blacklist = client.BlacklistCheck(ip);
var blacklist = await client.BlacklistCheckAsync(ip);
var validityPercent = result.GoodPercent;

IP To Hostname Lookup Tool

This tool provides the hostname of an IP address. (ie 192.168.1.1)

var hostname = client.LookupHostname(ip);
var hostname = await client.LookupHostnameAsync(ip);

Hostname to IP Lookup Tool

This tool provides the IP address of a hostname (ie www.yahoo.com)

var resultIPs = client.LookupIPAddress("www.yahoo.com");
var resultIPs = await client.LookupIPAddressAsync("www.yahoo.com");

Full Test Example Here

Supported Platforms

.NET Standard 1.3

Dependencies