ipfinder 1.0.0
ipfinder
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
<img src='https://camo.githubusercontent.com/46886c3e689a0d4a3f6c0733d1cab5d9f9a3926d/68747470733a2f2f697066696e6465722e696f2f6173736574732f696d616765732f6c6f676f732f6c6f676f2e706e67' height='60' alt='IP Finder'></a>
IPFinder D Client Library
The official D client library for the IPFinder.io get details for :
- IP address details (city, region, country, postal code, latitude and more ..)
- ASN details (Organization name, registry,domain,comany_type, and more .. )
- Firewall by supported formats details (apacheallow, nginxdeny, CIDR , and more ..)
- IP Address Ranges by the Organization name details (listasn, listprefixes , and more ..)
- service status details (queriesPerDay, queriesLeft, keytype, keyinfo)
- Get Domain IP (asn, organization,country_code ....)
- Get Domain IP history (totalip, listip,organization,asn ....)
- Get list Domain By ASN, Country,Ranges (selectby , totaldomain , list_domain ....)
Getting Started
singup for a free account at https://ipfinder.io/auth/signup, for Free IPFinder API access token.
The free plan is limited to 4,000 requests a day, and doesn't include some of the data fields To enable all the data fields and additional request volumes see https://ipfinder.io/pricing.
Documentation
See the official documentation.
Installation
Installing using dub:
$ dub add ipfinder
With free
TOKEN
import std.stdio : stdout, stderr;
import ipfinder;
import std.json;
void main()
{
Ipfinder ipfinder = new Ipfinder(); // emty token == free
try {
// lookup your IP address information
JSONValue response = ipfinder.authentication();
// dump data
writeln(response);
// print city
writeln(auth.object["city"]);
} catch (Exception e) {
// Handle error
}
}
Authentication
import std.stdio : stdout, stderr;
import ipfinder;
import std.json;
void main()
{
Ipfinder ipfinder = new Ipfinder("YOUR_TOKEN_GOES_HERE");
try {
// lookup your IP address information
JSONValue response = ipfinder.authentication();
writeln(response);
// print city name
writeln(response.getCity());
} catch (Exception e) {
// Handle error
}
}
Get IP address
import std.stdio : stdout, stderr;
import ipfinder;
import std.json;
// lookup IP address information
void main()
{
Ipfinder ipfinder = new Ipfinder("YOUR_TOKEN_GOES_HERE");
try {
// lookup your IP address information
string ip = "5.2.0.2";
JSONValue response = ipfinder.getAddressInfo(ip);
writeln(response);
// print city name
writeln(response.getCity());
} catch (Exception e) {
// Handle error
}
}
Get ASN
This API available as part of our Pro and enterprise https://ipfinder.io/pricing.
import std.stdio : stdout, stderr;
import ipfinder;
import std.json;
// lookup Asn information
void main()
{
Ipfinder ipfinder = new Ipfinder("YOUR_TOKEN_GOES_HERE");
try {
// lookup Asn information
string asn = "as36947";
JSONValue response = ipfinder.getAsn(asn);
// print data
writeln(response);
} catch (Exception e) {
// Handle error
}
}
Firewall
This API available as part of our enterprise https://ipfinder.io/pricing.
formats supported are : apache_allow
, apache_deny
,nginx_allow
,nginx_deny
, CIDR
, linux_iptables
, netmask
, inverse_netmask
, web_config_allow
, web_config_deny
, cisco_acl
, peer_guardian_2
, network_object
, cisco_bit_bucket
, juniper_junos
, microtik
import std.stdio : stdout, stderr;
import ipfinder;
import std.json;
void main()
{
Ipfinder ipfinder = new Ipfinder("YOUR_TOKEN_GOES_HERE");
try {
string asn = "as36947";
string format = "nginx_deny";
string response = ipfinder.getFirewall(asn,format);
// print data
writeln(response);
} catch (Exception ex) {
// Handle error
writeln(e);
}
}
Get IP Address Ranges
This API available as part of our enterprise https://ipfinder.io/pricing.
import std.stdio : stdout, stderr;
import ipfinder;
import std.json;
void main()
{
Ipfinder ipfinder = new Ipfinder("YOUR_TOKEN_GOES_HERE");
try {
string org = "Telecom Algeria";
JSONValue response = ipfinder.getRanges(org);
// print data
writeln(response);
} catch (Exception ex) {
// Handle error
writeln(e);
}
}
Get service status
import std.stdio : stdout, stderr;
import ipfinder;
import std.json;
void main()
{
Ipfinder ipfinder = new Ipfinder("YOUR_TOKEN_GOES_HERE");
try {
JSONValue response = ipfinder.getStatus();
// print data
writeln(response);
} catch (Exception ex) {
// Handle error
writeln(e);
}
}
Get Domain IP
import std.stdio : stdout, stderr;
import ipfinder;
import std.json;
void main()
{
Ipfinder ipfinder = new Ipfinder("YOUR_TOKEN_GOES_HERE");
try {
string name = "google.com";
JSONValue response = ipfinder.getDomain(name);
// print data
writeln(response);
} catch (Exception ex) {
// Handle error
writeln(e);
}
}
Get Domain IP history
import std.stdio : stdout, stderr;
import ipfinder;
import std.json;
void main()
{
Ipfinder ipfinder = new Ipfinder("YOUR_TOKEN_GOES_HERE");
try {
string name = "google.com";
JSONValue response = ipfinder.getDomainHistory(name);
// print data
writeln(response);
} catch (Exception ex) {
// Handle error
writeln(e);
}
}
Get list Domain By ASN, Country,Ranges
import std.stdio : stdout, stderr;
import ipfinder;
import std.json;
void main()
{
Ipfinder ipfinder = new Ipfinder("YOUR_TOKEN_GOES_HERE");
try {
string by = "DZ";
JSONValue response = ipfinder.getDomainBy(by);
// print data
writeln(response);
} catch (Exception ex) {
// Handle error
writeln(e);
}
}
Add proxy
Ipfinder ipfinder = new Ipfinder("YOUR_TOKEN_GOES_HERE", "https://ipfinder.yourdomain.com");
Sample codes under examples/ folder.
Contact
Contact Us With Additional Questions About Our API, if you would like more information about our API that isn’t available in our IP geolocation API developer documentation, simply contact us at any time and we’ll be able to help you find what you need.
License
- Registered by Mohamed Benrebia
- 1.0.0 released 5 years ago
- ipfinder-io/ip-finder-dlang
- ipfinder.io
- Apache-2.0
- Copyright © 2019, Mohamed Ben rebia, ipfinder.io Teams
- Authors:
- Dependencies:
- none
- Versions:
-
1.0.0 2019-Aug-21 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
9 downloads total
-
- Score:
- 0.0
- Short URL:
- ipfinder.dub.pm