ipisp icon indicating copy to clipboard operation
ipisp copied to clipboard

Query IP address network information in Go

ipisp

GoDoc

ipisp provides a Go client for Team Cymru's IP-ASN mapping service. Basically, this library allows you to query an IP address' ISP and allocation information.

go get github.com/ammario/ipisp/v2

Features

  • 0 external dependencies
  • Bulk and single lookups
  • Query ISP name, ASN, country, registry and CIDR range

Basic usage

Running

resp, err := ipisp.LookupIP(context.Background(), net.ParseIP("4.2.2.2"))
if err != nil {
    log.Fatalf("lookup: %v", err)
}
fmt.Printf("ISP: %s\n", resp.ISPName)

displays

ISP: LEVEL3, US