Official Go client for ipdata.info — a free, fast IP geolocation, ASN, and threat-intelligence API. Look up country, city, ASN, timezone, currency, and security flags (proxy/VPN/Tor/hosting) for any IPv4 or IPv6 address. Powered by ipdata.info.
The public endpoint is free — 50 requests/min, no signup, no key. For higher rate limits and batch lookups, create a free API key at ipdata.info/register and manage it in your dashboard.
go get github.com/IPDataInfo/ipdata-go
package main
import (
"context"
"fmt"
ipdata "github.com/IPDataInfo/ipdata-go"
)
func main() {
client := ipdata.New() // free tier; or ipdata.New(ipdata.WithAPIKey("KEY"))
info, _ := client.Lookup(context.Background(), "8.8.8.8")
fmt.Println(info.City, info.Country, info.ASNOrg) // Mountain View United States Google LLC
}| Method | What it returns |
|---|---|
Lookup(ctx, ip) |
Full geolocation record (own IP if ip == "") |
Geo(ctx, ip) |
Geo subset (city/region/country/lat/lon/tz) |
ASN(ctx, ip) |
ASN + ISP/registry for an IP |
Batch(ctx, ips) |
Many IPs at once (requires an API key) |
ASNDetail(ctx, n) |
ASN detail incl. prefixes |
ASNWhoisHistory(ctx, n) |
ASN whois history |
ASNChanges(ctx) |
ASN change feed |
ThreatDomain/ThreatHash/ThreatURL(ctx, x) |
Threat-intel lookup (domain / hash / URL) |
Full response schema: ipdata.info API docs · SDK list.
ipdata.New(
ipdata.WithAPIKey("KEY"), // sent as X-Api-Key; switches to pro.ipdata.info
ipdata.WithBaseURL("https://ipdata.info"),
ipdata.WithHTTPClient(customHTTPClient), // custom timeout/proxy
)Errors from non-2xx responses are returned as *ipdata.APIError with Status
and Message.
- Free (
ipdata.info): 50 req/min, no key. - Paid (
pro.ipdata.info): higher limits +Batch, with an API key.
12 official SDKs — see ipdata.info/docs/sdks: Python, Node.js, Go, PHP, Java, Rust, .NET, Kotlin, Swift, Dart, Bash, Objective-C.
MIT © ipdata.info