Prerequisites
- Go 1.21+ with
ipapi-goinstalled - A free ip-api.io API key
Read SuspiciousFactors on any lookup
No dedicated call needed — the flags ride along with a normal LookupIP.
client := ipapi.NewClient(ipapi.WithAPIKey(os.Getenv("IP_API_IO_KEY")))
ctx := context.Background()
info, err := client.LookupIP(ctx, "185.220.101.1")
if err != nil {
log.Fatal(err)
}
f := info.SuspiciousFactors
fmt.Println(f.IsVPN) // VPN service
fmt.Println(f.IsProxy) // open / anonymizing proxy
fmt.Println(f.IsTorNode) // Tor node
fmt.Println(f.IsDatacenter) // hosting / datacenter IP (often a bot)
fmt.Println(f.IsSpam) // known spam source
fmt.Println(f.IsCrawler) // known crawler / bot
fmt.Println(f.IsThreat) // listed on a threat feed
if f.IsVPN || f.IsProxy || f.IsTorNode {
// require step-up verification (CAPTCHA, 2FA)
} Confirm a Tor exit node with TorCheck
A dedicated check against the live Tor node list, with a count of matching nodes.
tor, _ := client.TorCheck(ctx, "185.220.101.1")
fmt.Println(tor.IsTor) // true
fmt.Println(tor.TorNodeCount) // number of matching Tor nodes RiskScoreIP.