# Minecraft Server Scanner (`mr-brogrammer/minecraft-server-scanner`) Actor

Minecraft Server Scanner: Finds public and private Minecraft servers at scale. Scans IPv4 ranges for port 25565 (the default minecraft server port), verifies if it's minecraft servers, and saves rich JSON (version, players, MOTD, etc.) to the Apify dataset/output.

- **URL**: https://apify.com/mr-brogrammer/minecraft-server-scanner.md
- **Developed by:** [Mr\_Brogrammer](https://apify.com/mr-brogrammer) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 303 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$30.00 / 1,000 scanning a subnets

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Minecraft Server Scanner

An Apify Actor that scans IP ranges to discover Minecraft servers across the internet and collects detailed information about them.

### Features

- **Fast Scanning**: Uses masscan to efficiently scan /16 subnets (65,536 IPs each)
- **Server Verification**: Verifies each discovered host is actually a Minecraft server
- **Detailed Data Collection**: Captures version, player count, descriptions, and online players
- **Cloud Scalable**: Runs on Apify's infrastructure with progress tracking and checkpoints
- **Pay-per-Event**: Fair pricing model - you only pay for subnets actually scanned
- **JSON Output**: Clean, structured data output optimized for analysis

### Input Parameters

- `start_ip` (string): Starting IP address as JSON array (e.g., `"[185,130,197,0]"`)
- `max_subnets` (integer): Number of /16 subnets to scan (each subnet = 65,536 IPs)
- `timeout_per_server` (integer): Timeout for each Minecraft server check (5-30 seconds)

#### Example Input

```json
{
  "start_ip": "[185,130,197,0]",
  "max_subnets": 5,
  "timeout_per_server": 10
}
```

### Output Format

Each discovered server is saved to the Apify dataset with the following structure:

```json
{
  "address": "185.130.90.243:25565",
  "version": "Paper 1.21.1",
  "players_online": 3,
  "players_max": 20,
  "description": "Welcome to our survival server!",
  "player_list": ["Steve", "Alex", "Notch"],
  "online_players": "Steve, Alex, Notch",
  "found_at": "2025-09-07T12:00:00.000Z",
  "subnet": "185.130.0.0/16"
}
```

#### UI Display

The actor shows a clean table view with these columns:

- **Server Address** | **Version** | **Online** | **Max Players** | **Description** | **Players**

Additional metadata (`player_list`, `found_at`, `subnet`) is stored in the dataset but hidden from the table view for cleaner presentation.

### How It Works

1. **Port Scanning**: Uses masscan at 40,000 packets/sec to scan for open port 25565
2. **Server Verification**: Queries each discovered host with mcstatus to verify it's a Minecraft server
3. **Data Collection**: Extracts server version, player counts, description (MOTD), and player names
4. **Progress Tracking**: Automatically saves progress and can resume from interruptions
5. **Pay-per-Event**: Charges once per subnet scanned for fair, transparent pricing

### Pricing

This actor uses a pay-per-event model:

- **Event**: `subnet-scanned`
- **Cost**: Set by the actor publisher
- **Fair Usage**: You only pay for subnets actually scanned, regardless of how many servers are found

### Example Usage

To scan 3 subnets starting from 185.130.197.0:

```json
{
  "start_ip": "[185,130,197,0]",
  "max_subnets": 3,
  "timeout_per_server": 10
}
```

This will scan:

- 185.130.0.0/16 (65,536 IPs)
- 185.131.0.0/16 (65,536 IPs)
- 185.132.0.0/16 (65,536 IPs)

### Logs and Monitoring

The actor provides detailed logs:

- `🔍 Scanning subnet X/Y: A.B.0.0/16`
- `💳 Charged for scanning subnet: A.B.0.0/16`
- `📡 Found X hosts with port 25565 open`
- `✅ Found server: IP:25565 | Version | Players`
- `📈 Subnet complete. Found X Minecraft servers`

### Limitations

- **Scan Rate**: Optimized at 40,000 packets/sec for cloud performance
- **Network Dependencies**: Requires raw socket access (provided by Apify infrastructure)
- **Server Timeouts**: Some servers may timeout during verification
- **Rate Limits**: Some networks may implement rate limiting

### Use Cases

- **Server Discovery**: Find public Minecraft servers for directories or analysis
- **Market Research**: Analyze server versions, player counts, and descriptions
- **Network Analysis**: Study Minecraft server distribution across IP ranges
- **Competitive Intelligence**: Monitor server landscapes in specific regions

### Technical Details

- **Masscan**: Fast SYN scanner for initial port discovery
- **mcstatus**: Python library for Minecraft server status queries
- **Concurrency**: Asynchronous server verification for efficiency
- **Checkpoints**: Automatic progress saving for reliable resumption

### Support

For issues or questions, contact the actor publisher or refer to the Apify documentation.

***

**Author**: [Mr\_Brogrammer](https://github.com/Lukibukiboy)\
**License**: MIT

# Actor input Schema

## `start_ip` (type: `string`):

Starting IP address as JSON array \[a,b,c,d]. Example: \[185,110,0,0]

## `max_subnets` (type: `integer`):

Number of /16 subnets to scan (each = 65,536 IPs)

## `timeout_per_server` (type: `integer`):

Timeout in seconds for each Minecraft server check

## Actor input object example

```json
{
  "start_ip": "[185,130,197,0]",
  "max_subnets": 2,
  "timeout_per_server": 10
}
```

# 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("mr-brogrammer/minecraft-server-scanner").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("mr-brogrammer/minecraft-server-scanner").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 mr-brogrammer/minecraft-server-scanner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mr-brogrammer/minecraft-server-scanner"
        }
    }
}

```

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/0xeOjhpAEyDX1xPaf/builds/PbRGLbMnEmsNDlchO/openapi.json
