Intermediate10 min
Bulk IP Lookups
When processing server logs, firewall events, or large IP lists you need to check many addresses at once. The bulk endpoint lets you submit up to 100 IPs in a single request.
1
Prepare your IP list
Collect the IP addresses you want to check into an array. IPv4 and IPv6 are both supported.
ips.js
const ips = [
"1.2.3.4",
"5.6.7.8",
"2001:db8::1",
// up to 100 addresses
];2
Send the bulk request
POST the array to the bulk-lookup endpoint. The response preserves the input order so you can zip the results back to your original list.
bulk.js
const res = await fetch(
"https://api.ipabuse.org/v1/ip/bulk-lookup",
{
method: "POST",
headers: {
"X-API-Key": process.env.IPABUSE_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ ips }),
}
);
const { data } = await res.json();
// data.results is an array aligned to your input3
Filter high-risk results
Iterate the results and act on any IP with a high risk level.
filter.js
const highRisk = data.results.filter(
(r) => r.riskLevel === "HIGH" || r.riskLevel === "CRITICAL"
);
for (const ip of highRisk) {
console.log(`Blocking ${ip.ipAddress} — score ${ip.reputationScore}`);
await blockIp(ip.ipAddress);
}