Go SDK · Feature

Fraud Detection & Risk Scoring in Go

Collapse every signal — geolocation, proxy/VPN/Tor flags, datacenter hosting, disposable email, syntax — into a single 0–100 risk score you can act on at sign-up, checkout, or login. Or pull the raw IPReputation record when you want to build your own rules.

Trusted by thousands of businesses
Fast JSON API responses
Real-time validation
Simple integration, SDKs & examples
What it does

One score from every signal

Individual flags are powerful, but acting on each one is fiddly. RiskScoreIP weighs geolocation, anonymizer flags, datacenter hosting, and email quality into a single number with a bucketed level, so you can make a block / review / allow decision in one comparison — and still drill into the contributing factors when you need to explain a decision.

Prerequisites

1

Score an IP with RiskScoreIP

Returns a Score (0–100) and a human RiskLevel, plus the Factors that drove it. Use RiskScore(ctx) for the caller's IP.

client := ipapi.NewClient(ipapi.WithAPIKey(os.Getenv("IP_API_IO_KEY")))
ctx := context.Background()

risk, err := client.RiskScoreIP(ctx, "185.220.101.1")
if err != nil {
	log.Fatal(err)
}

fmt.Println(risk.Score)     // 88
fmt.Println(risk.RiskLevel) // "high"
if risk.Factors.IPFactors != nil {
	fmt.Println(risk.Factors.IPFactors.IsTorNode, risk.Factors.IPFactors.IsDatacenter)
}

if risk.Score >= 75 {
	// block, or send to manual review / step-up auth
}
2

Score an email with EmailRiskScore

Same 0–100 scale, driven by email signals (disposable provider, invalid syntax). Use it to grade leads or gate sign-ups by address quality.

risk, _ := client.EmailRiskScore(ctx, "user@mailinator.com")

fmt.Println(risk.Score, risk.RiskLevel) // 90 high
if risk.Factors.EmailFactors != nil {
	fmt.Println(risk.Factors.EmailFactors.IsDisposable) // true
}
3

Raw signals with IPReputation

Returns the underlying reputation data for an IP as a map[string]any — use it when you want the source signals rather than a computed score.

reputation, _ := client.IPReputation(ctx, "185.220.101.1")
fmt.Println(reputation)
Reference

Response reference

RiskScore (from RiskScoreIP / EmailRiskScore)

FieldTypeDescription
Scorefloat64Risk score, 0 (safe) – 100 (high risk)
RiskLevelstringBucketed level, e.g. "low", "medium", "high"
IP*stringScored IP (when applicable)
Email*stringScored email (when applicable)
FactorsRiskScoreFactorsIPFactors and/or EmailFactors (pointers)

IPFactors: IsProxy, IsVPN, IsTorNode, IsSpam, IsDatacenter, RiskContribution. EmailFactors: IsDisposable, IsValidSyntax, RiskContribution.

FAQ

Frequently asked questions

How do I score an IP for fraud risk in Go?

Call client.RiskScoreIP(ctx, ip). It returns a Score from 0 (safe) to 100 (high risk), a human RiskLevel, and the Factors that drove it. Use RiskScore(ctx) to score the caller's own IP.

Can I score an email address too?

Yes. client.EmailRiskScore(ctx, email) returns the same 0–100 scale driven by email signals such as disposable provider and invalid syntax — use it to grade leads or gate sign-ups by address quality.

What's the difference between RiskScoreIP and IPReputation?

RiskScoreIP gives you a computed 0–100 score and bucketed level you can act on directly. IPReputation(ctx, ip) returns the underlying reputation record as a map[string]any — use it when you want the source signals to build your own rules.

What threshold should I block at?

A common pattern is to allow low scores, send medium scores to step-up verification, and block or manually review high scores (e.g. risk.Score >= 75). Tune the cutoffs to your own fraud tolerance and false-positive budget.

Start building with the ip-api.io Go SDK

Run go get github.com/ip-api-io/ipapi-go, drop in your free API key, and ship in minutes — one typed, context-aware client for geolocation, fraud detection, and email validation.

Need support?

Explore how IP-API.io can enhance your security, provide robust bot protection, and improve IP geolocation accuracy for your applications.

Contact Support

Found a bug in the SDK?

The ipapi-go module is open source. Open an issue or pull request on GitHub and we'll take a look.

Open on GitHub