Go
Official Golang client library for the ipdata API - https://github.com/ipdata/go

Installation

1
go get github.com/ipdata/go
Copied!

Basic Usage

1
package main
2
3
import (
4
"github.com/ipdata/go"
5
"log"
6
"fmt"
7
)
8
9
func main() {
10
ipd, _ := ipdata.NewClient("test")
11
data, err := ipd.Lookup("8.8.8.8")
12
if err != nil {
13
log.Fatalf("%v", err)
14
}
15
16
fmt.Printf("%s (%s)\n", data.IP, data.ASN)
17
}
Copied!
Last modified 1yr ago
Copy link