Skip to content

ipfinder-io/ip-finder-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IP Finder

IPFinder Go Client Library

The official Go 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 (apache_allow, nginx_deny, CIDR , and more ..)
  • IP Address Ranges by the Organization name details (list_asn, list_prefixes , and more ..)
  • service status details (queriesPerDay, queriesLeft, key_type, key_info)
  • Get Domain IP (asn, organization,country_code ....)
  • Get Domain IP history (total_ip, list_ip,organization,asn ....)
  • Get list Domain By ASN, Country,Ranges (select_by , total_domain , 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

go get github.com/ipfinder-io/ip-finder-go/ipfinder

With free TOKEN

// lookup your IP address information
func main() {
	conf := ipfinder.New("", "") // "" == free token or use "free"
	auth, err := conf.Authentication()

	if err != nil {
		fmt.Println("Error : ", err)
	} else {
		fmt.Println(auth)
	}
}

Authentication

// lookup your IP address information
func main() {
	conf := ipfinder.New("YOUR_TOKEN_GOES_HERE", "")
	auth, err := conf.Authentication()

	if err != nil {
		fmt.Println("Error : ", err)
	} else {
		fmt.Println(auth)
	}
}

Get IP address

// lookup IP address information
func main() {
	conf := ipfinder.New("YOUR_TOKEN_GOES_HERE", "")
	ip, err := conf.GetAddressInfo("1.0.0.0")

	if err != nil {
		fmt.Println("Error : ", err)
	} else {
		fmt.Println(ip)
	}
}

Get ASN

This API available as part of our Pro and enterprise https://ipfinder.io/pricing.

// lookup Asn information
func main() {
	conf := ipfinder.New("YOUR_TOKEN_GOES_HERE", "") 
	asn, err := conf.GetAsn("as1")

	if err != nil {
		fmt.Println("Error : ", err)
	} else {
		fmt.Println(asn)
	}
}

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

// lookup Asn Firewall information
func main() {
	conf := ipfinder.New("YOUR_TOKEN_GOES_HERE", "") 
	fire, err := conf.GetFirewall("as1", "nginx_deny")

	if err != nil {
		fmt.Println("Error : ", err)
	} else {
		fmt.Println(fire)
	}
}

Get IP Address Ranges

This API available as part of our enterprise https://ipfinder.io/pricing.

// lookup Organization information
func main() {
	conf := ipfinder.New("YOUR_TOKEN_GOES_HERE", "")
	ranges, err := conf.GetRanges("Telecom Algeria")

	if err != nil {
		fmt.Println("Error : ", err)
	} else {
		fmt.Println(ranges)
	}
}

Get service status

// lookup IP TOKEN information
func main() {
	conf := ipfinder.New("YOUR_TOKEN_GOES_HERE", "")
	stats, err := conf.GetStatus()

	if err != nil {
		fmt.Println("Error : ", err)
	} else {
		fmt.Println(stats)
	}
}

Get Domain IP

// Get domain name
func main() {
	conf := ipfinder.New("YOUR_TOKEN_GOES_HERE", "")
	domain, err := conf.GetDomain("google.dz")

	if err != nil {
		fmt.Println("Error : ", err)
	} else {
		fmt.Println(domain)
	}
}

Get Domain IP history

// Get domain name IP list history
func main() {
	conf := ipfinder.New("YOUR_TOKEN_GOES_HERE", "") 
	domain, err := conf.GetDomainHistory("google.dz")

	if err != nil {
		fmt.Println("Error : ", err)
	} else {
		fmt.Println(domain)
	}
}

Get list Domain By ASN, Country,Ranges

// list live domain by country DZ,US,TN,FR,MA
func main() {
	conf := ipfinder.New("YOUR_TOKEN_GOES_HERE", "") 
	domain, err := conf.GetDomainBy("DZ")

	if err != nil {
		fmt.Println("Error : ", err)
	} else {
		fmt.Println(domain)
	}
}

Add proxy

conf := ipfinder.New("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


GitHub license

About

Official Go client library for IPfinder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages