IPAbuse Developers
Beginner5 min

Your First IP Lookup

This tutorial walks you through querying the IPAbuse API for the first time. By the end you will be able to look up any IPv4 or IPv6 address and interpret the reputation score.

1

Get your API key

Create a free account at ipabuse.org, then go to Settings → API Keys and click Create New Key. Copy the key — it is only shown once.

2

Make your first request

Replace YOUR_API_KEY with your key and 1.2.3.4 with any IP address you want to check.

cURL
curl https://api.ipabuse.org/v1/ip/1.2.3.4/reputation \
  -H "X-API-Key: YOUR_API_KEY"
3

Parse the response

A successful response looks like this. The reputationScore runs from 0 (most abusive) to 100 (completely clean). riskLevel is one of LOW, MEDIUM, HIGH, or CRITICAL.

response.json
{
  "success": true,
  "data": {
    "ipAddress": "1.2.3.4",
    "reputationScore": 45,
    "riskLevel": "MEDIUM",
    "totalReports": 3,
    "verifiedReports": 1,
    "categories": ["SPAM", "BRUTE_FORCE"],
    "country": "US",
    "isp": "Example ISP",
    "cached": false
  }
}
4

Handle errors

If the API key is missing or invalid you will receive a 401. If you hit your rate limit you will receive a 429 with a Retry-After header. Always check the success field before accessing data.

lookup.js
const res = await fetch(
  "https://api.ipabuse.org/v1/ip/1.2.3.4/reputation",
  { headers: { "X-API-Key": process.env.IPABUSE_API_KEY } }
);

if (!res.ok) {
  const { error } = await res.json();
  throw new Error(`IPAbuse API error: ${error}`);
}

const { data } = await res.json();
console.log(data.reputationScore, data.riskLevel);