# Spamhaus Drop List Scraper (`b2b_lead_generation/spamhaus-drop-list-scraper`) Actor

Download and extract Spamhaus DROP IPv4 netblock lists and SBL IDs into clean JSON, CSV, or Excel, or perform local IP lookups against the fee

- **URL**: https://apify.com/b2b_lead_generation/spamhaus-drop-list-scraper.md
- **Developed by:** [B2B Lead Generation](https://apify.com/b2b_lead_generation) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Spamhaus DROP List Scraper

![Spamhaus DROP List Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/spamhaus-drop-list-scraper-cover.png)

Collect Spamhaus DROP IPv4 netblock information in structured JSON, CSV, or Excel formats. Download the public DROP list or check individual IP addresses against its listed CIDR ranges. Retrieve CIDRs, Spamhaus SBL identifiers, and Regional Internet Registry information for network security research, threat intelligence, and IP screening.

### What This Actor Does

This actor collects publicly available Spamhaus DROP IPv4 netblock data and provides two collection modes.

- **DROP (`drop`):** Collect entries from the Spamhaus DROP IPv4 list.
- **Lookup (`lookup`):** Check supplied IP addresses against the DROP list and identify matching netblocks.

Each list result includes the CIDR range, SBL identifier, RIR label, source URL, and collection timestamp. Failed operations are recorded as error rows so processing can continue.

### Input Examples

**DROP list mode**

```json
{
  "mode": "drop",
  "maxItems": 50
}
```

**IP lookup mode**

```json
{
  "mode": "lookup",
  "ips": ["1.10.16.1", "8.8.8.8"],
  "maxItems": 50
}
```

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `drop` | Select `drop` to collect the full list or `lookup` to check IP addresses. |
| `ips` | array | `[]` | IP addresses to check in lookup mode. |
| `maxItems` | integer | `100` | Maximum number of CIDR rows to collect. |
| `userAgent` | string | `ActorResearch/1.0` | User-Agent value used for requests. |
| `timeoutSecs` | integer | `300` | Overall actor run timeout in seconds. |
| `requestTimeoutSecs` | integer | `30` | Timeout for individual requests in seconds. |
| `proxyConfiguration` | object | No proxy | Optional proxy configuration. |

### Output Example

```json
{
  "cidr": "1.10.16.0/20",
  "sblid": "SBL256894",
  "rir": "apnic",
  "scrapedAt": "2026-10-26T00:00:00+00:00"
}
```

### Output Fields

| Field | Type | Description |
|---|---|---|
| `cidr` | string | CIDR network range listed by Spamhaus. |
| `sblid` | string | Spamhaus SBL identifier associated with the netblock. |
| `rir` | string | Regional Internet Registry label, such as `apnic`. |
| `scrapedAt` | string | ISO timestamp when the result was collected. |

### Use Cases

- **Blocklist Synchronization:** Collect DROP CIDR ranges for firewall and SIEM workflows.
- **Incident Response:** Check IP addresses from security logs against listed netblocks.
- **Threat Intelligence:** Build structured datasets containing hijacked netblock ranges and SBL identifiers.
- **Network Security Research:** Review listed IP ranges and associated registry information.
- **Compliance Monitoring:** Maintain dated snapshots of DROP list information.
- **IP Enrichment:** Check incoming IP address lists for matches against DROP entries.

### Frequently Asked Questions

**What collection modes are available?**

The actor supports `drop` mode for collecting the IPv4 list and `lookup` mode for checking supplied IP addresses against its CIDR ranges.

**Can I check multiple IP addresses in one run?**

Yes. Provide the addresses in the `ips` array and select `lookup` mode.

**What happens when an IP matches a DROP range?**

The lookup identifies the matching CIDR information available in the collected DROP data.

**Why might lookup return fewer rows than expected?**

Lookup results depend on whether supplied IP addresses match listed CIDR ranges. The number of results may also depend on the available source data and `maxItems` setting.

**Can I export the results?**

Yes. Export the collected dataset in JSON, CSV, Excel, and other supported Apify formats.

**Can I schedule recurring collections?**

Yes. Use Apify schedules to refresh your dataset. Follow Spamhaus's published usage conditions when choosing a schedule.

### Trademark Notice

Spamhaus and its associated names, logos, and trademarks belong to their respective owners. This actor is an independent data collection tool and does not imply affiliation, sponsorship, or endorsement by Spamhaus.

### Is Web Scraping Legal?

This actor collects publicly accessible Spamhaus DROP list information without bypassing login screens, paywalls, or technical security measures. How collected information can be used depends on applicable laws and the source website's policies.

- **Personal Data:** IP addresses may be associated with identifiable individuals or organizations. Privacy laws such as GDPR and CCPA may apply. Use collected information responsibly and only when you have an appropriate lawful basis.
- **Copyright and Licensing:** Check Spamhaus's applicable data usage conditions before reproducing, redistributing, or incorporating its published lists into other products or services.
- **Platform Terms and Rate Limits:** Respect Spamhaus's published terms and collection frequency requirements. Review its usage conditions before using the data, particularly for commercial purposes.
- **Disclaimer:** This information is general guidance, not legal advice. Consult a qualified legal professional about your specific use case.

For more information, read Apify's guide: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `mode` (type: `string`):

What to scrape. DROP downloads the Spamhaus DROP v4 CIDR list. Lookup checks IPs against that list locally.

## `ips` (type: `array`):

IPs to check in Lookup mode, one per line.

## `maxItems` (type: `integer`):

Stop after this many CIDR rows. Hard max is 1000.

## `userAgent` (type: `string`):

Identify your scraper

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy. Leave off unless you need it. Spamhaus DROP usually works without a proxy.

## Actor input object example

```json
{
  "mode": "drop",
  "ips": [],
  "maxItems": 100,
  "userAgent": "BigiByteActorResearch/1.0 (contact: hello@bigibyte.com)",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

## `dataset` (type: `string`):

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("b2b_lead_generation/spamhaus-drop-list-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("b2b_lead_generation/spamhaus-drop-list-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call b2b_lead_generation/spamhaus-drop-list-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,b2b_lead_generation/spamhaus-drop-list-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/yohBrIIhdx4pa0JMJ/builds/zefhTTEwXYchn1KeI/openapi.json
