Integrate enterprise-grade IP intelligence into your applications with our powerful REST API.
Generate your API key from the dashboard
Send HTTP requests to our endpoints
Receive JSON response with threat data
All API requests require authentication using your API key. Include it in the request header:
X-API-KEY: YOUR_API_KEY
https://affguard.ai/api/v1
Analyze an IP address for VPN, proxy, Tor, and datacenter detection.
Cache HIT (<20ms) applies to previously-seen IPs served from Redis. DB lookup (50–120ms) runs a range query against the intelligence database. AI Engine adds ~800ms–1.5s only when enabled on your key and the IP is brand new to our system.
GET /api/v1/ip/lookup?ip={ip}
| Parameter | Type | Required | Description |
|---|---|---|---|
ip |
string | Yes | IPv4 or IPv6 address to analyze |
curl -X GET "https://affguard.ai/api/v1/ip/lookup?ip=8.8.8.8" \
-H "X-API-KEY: YOUR_API_KEY"
{
"ip": "8.8.8.8",
"country": "US",
"is_vpn": "no",
"is_proxy": "no",
"is_tor": "no",
"is_bot": "no",
"is_hosting": "yes",
"is_blacklist": "no",
"is_residential": "no",
"risk_score": 40,
"fraud_score": 30,
"confidence": 80,
"threat_categories": ["datacenter_hosting"],
"subnet_risk": 12.50,
"is_abusive": "no",
"abuse_reports": 0,
"is_market_research_flagged": "no",
"market_research_reports": 0
}
| Field | Format | Description |
|---|---|---|
ip |
string | The IP address queried in the request. |
country |
string | Two-letter ISO 3166-1 country code (e.g., "US", "GB"). |
is_vpn |
yes/no | Returns "yes" if identified as a Virtual Private Network. |
is_proxy |
yes/no | Returns "yes" if identified as a non-anonymous or commercial proxy. |
is_tor |
yes/no | Returns "yes" if identified as an active Tor Exit Node. |
is_bot |
yes/no | Returns "yes" if the IP belongs to a known crawler or bot. |
is_hosting |
yes/no | Returns "yes" if the IP is from a cloud provider or data center. |
is_blacklist |
yes/no | Returns "yes" if the IP is found on global threat/spam blacklists. |
risk_score |
int (0–100) | Technical risk score based on the connection nature. |
fraud_score |
int (0–100) | Behavioral risk score based on historical abuse. |
confidence |
int (0–100) | null | Data confidence score. Higher values indicate more trusted provider sources. Returns null when no provider data is available. |
threat_categories |
array | Classified threat labels for this IP, ordered by severity. Possible values: tor_exit_node, vpn, proxy, datacenter_hosting, bot, blacklisted, cpa_fraud, survey_fraud, geo_asn_mismatch, dns_inconsistency, contaminated_subnet, residential. Returns an empty array when no threats are detected. |
subnet_risk |
float (0–100) | null | Percentage of flagged IPs within the same /24 subnet. Higher values indicate a contaminated network neighbourhood. Returns null for IPv6 addresses. |
is_residential |
yes/no | Returns "yes" if identified as a residential proxy or ISP connection. Residential IPs receive a lower risk score. |
is_abusive |
yes/no | Returns "yes" if flagged for advertising/CPA fraud behavior. |
abuse_reports |
int | Number of unique CPA fraud reports associated with this IP. |
is_market_research_flagged |
yes/no | Returns "yes" if flagged for survey/panel market research fraud (fake traffic, incentivized clicks). |
market_research_reports |
int | Number of unique market research fraud reports associated with this IP. |
When a user attempts to open an offer from your Ad Network or Offerwall partners, check their IP first. If the risk_score is above 40, we recommend blocking the redirect to protect your advertiser reputation.
// Example Logic
if ($data['risk_score'] > 40) {
die("VPN/Proxy detected. Please disable it to continue to offers.");
}
The threat_categories field returns a structured array of detected threat types, ordered by severity. Use these labels to build routing rules, auto-block policies, or dashboard visualizations.
| Category | Trigger | Description |
|---|---|---|
tor_exit_node |
is_tor = yes | Active Tor exit node, anonymized traffic |
vpn |
is_vpn = yes | Commercial or personal VPN service |
proxy |
is_proxy = yes | HTTP/SOCKS proxy detected |
datacenter_hosting |
is_hosting = yes | Cloud provider or data center IP |
bot |
is_bot = yes | Known crawler or automated bot |
blacklisted |
is_blacklist = yes | Found on global threat or spam blacklists |
cpa_fraud |
is_abusive = yes | Flagged for CPA or advertising fraud |
survey_fraud |
is_market_research_flagged = yes | Flagged for survey or panel fraud |
geo_asn_mismatch |
Network anomaly detected | IP geolocation does not match ASN registration country |
dns_inconsistency |
Network anomaly detected | PTR hostname does not resolve back to the original IP |
contaminated_subnet |
subnet_risk ≥ 20% | High concentration of flagged IPs in the /24 network block |
residential |
is_residential = yes, no threats | Clean residential ISP connection (informational only) |
["vpn", "blacklisted", "cpa_fraud"]). An empty array [] means no threat signals were detected.
Our IP Intelligence system provides multiple scoring dimensions to help you make informed security decisions.
Technical threat level based on VPN, Proxy, Tor, and hosting indicators. 0-100
Behavioral risk combining historical abuse, provider data, and recency. 0-100
How much we trust the data, based on provider quality. 0-100 or null
Percentage of flagged IPs in the same /24 network block. 0-100
| Range | Level | Recommended Action |
|---|---|---|
0–25 |
Low | Safe for most transactions. High confidence in residential origin. |
26–55 |
Medium | Moderate risk. Recommended: Extra verification (e.g., OTP or Email confirmation). |
56–85 |
High | Significant risk. High probability of VPN/Proxy abuse. Recommended: Manual review. |
86–100 |
Critical | Extreme fraud risk. Blacklisted or multi-flagged IP. Recommended: Immediate rejection. |
| Code | Status | Description |
|---|---|---|
200 |
OK | Request successful |
400 |
Bad Request | Invalid IP address or parameters |
401 |
Unauthorized | Invalid or missing API key |
402 |
Payment Required | Insufficient balance |
429 |
Too Many Requests | Rate limit exceeded |
500 |
Server Error | Internal server error |
Rate limits vary by plan tier:
<?php
$apiKey = 'YOUR_API_KEY';
$ip = '8.8.8.8';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://affguard.ai/api/v1/lookup/$ip");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer $apiKey"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
echo "Risk Score: " . $data['risk_score'];
?>
import requests
api_key = 'YOUR_API_KEY'
ip = '8.8.8.8'
headers = {'Authorization': f'Bearer {api_key}'}
response = requests.get(f'https://affguard.ai/api/v1/lookup/{ip}', headers=headers)
data = response.json()
print(f"Risk Score: {data['risk_score']}")
const apiKey = 'YOUR_API_KEY';
const ip = '8.8.8.8';
fetch(`https://affguard.ai/api/v1/lookup/${ip}`, {
headers: {
'Authorization': `Bearer ${apiKey}`
}
})
.then(response => response.json())
.then(data => {
console.log('Risk Score:', data.risk_score);
});
curl -X GET "https://affguard.ai/api/v1/lookup/8.8.8.8" \
-H "Authorization: Bearer YOUR_API_KEY"
Our support team is here to assist you with integration and technical questions.
mail Contact Support