Skip to content

lafronzt/ipwhois

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IP Whois Go Client

This is an unofficial client for the IPWhois.io API.

Quick Start

Install and Use in Command Line:

go install github.com/lafronzt/ipwhois/cmd/ipwhois@latest

ipwhois -ip 1.1.1.1

Us as a Go Package

package main

imports (
    "fmt"
    "github.com/lafronzt/ipwhois"
)

var c *ipwhois.Client

func init() {

   c = ipwhois.NewClient()

}

func main() {

    ip := "1.1.1.1"

    whois, err := c.GetIPDetails(IP, nil)
    if err != nil {
      println(err.Error())
      return
    }

    fmt.Printf("%+v\n", whois)
}

To Use with the Pro Version of IPWhois.io use the following

ipwhois.NewClientPro("api-key")

Requirements

  • Go >= 1.15