Skip to main content

Python package for fetching Minecraft Java and Bedrock server status, players, version, and plugins.

Project description

minecraft_server_status

A lightweight Python package to fetch Minecraft Java and Minecraft Bedrock server status using the public mcstatus.io API.

This package provides simple classes and methods to check whether a server is online, view player counts, server version, plugins, software, and more — without handling raw HTTP requests yourself.


Features

  • Supports Minecraft Java Edition
  • Supports Minecraft Bedrock Edition
  • TTL-based caching (auto refresh after set time)
  • Fail-safe network handling (doesn’t crash on request errors)
  • Configurable timeout & TTL
  • Clean and simple method-based access
  • Full raw JSON access available
  • Minimal dependency (requests only)

Installation

Once published to PyPI:

pip install minecraft-server-status

For local development:

pip install -e .

Requirements

  • Python 3.9+
  • requests

Project Structure

minecraft_server_status/
│
├── pyproject.toml
├── README.md
├── LICENSE
└── src/
    └── minecraft_server_status/
        ├── __init__.py
        ├── java.py
        └── bedrock.py

Quick Start

Java Server Example

from minecraft_server_status import Java

# ttl = cache time in seconds (default 10)
server = Java("hypixel.net", ttl=15)

print(server.status())                 # True / False
print(server.players())                # Player information
print(server.java_minecraft_version()) # Version details
print(server.plugins())                # Plugin list
print(server.raw())                    # Full JSON response

Bedrock Server Example

from minecraft_server_status import Bedrock

server = Bedrock("play.example.com", ttl=20)

print(server.status())
print(server.players())
print(server.server_minecraft_version())
print(server.software())
print(server.raw())

TTL Caching Explained

TTL (Time To Live) controls how often the API is called.

Example:

server = Java("hypixel.net", ttl=30)
  • First call → Fetches API
  • Next calls within 30 sec → Uses cached data
  • After 30 sec → Auto refreshes

This prevents:

  • API spam
  • Rate limits
  • Slow performance

Error Handling

If the API request fails:

  • The package does not crash
  • Old cached data is reused
  • If no previous data exists → returns:
{"online": False, "error": "..."}

Java Class Methods

Method Description
status() Returns online status
ip() Resolved IP address
expires_at() Cache expiration timestamp
srv_record() SRV record information
java_minecraft_version() Minecraft version data
players() Player count & sample list
message_of_the_day() Server MOTD
icon() Base64 server icon
mods() Installed mods
software() Server software name
plugins() Plugin list
raw() Full API JSON

Bedrock Class Methods

Method Description
status() Online status
ip_address() Resolved IP
port_number() Server port
expires_at() Cache expiration timestamp
server_minecraft_version() Version details
players() Player data
gameMode() Current game mode
server_id() Unique server ID
edition() Bedrock edition info
software() Server software
plugins() Plugin list
raw() Full API JSON

How It Works

  • Uses https://api.mcstatus.io internally
  • Data is cached with TTL
  • Network errors are handled gracefully
  • Multiple method calls do not trigger multiple API requests
  • Designed for bots, dashboards, and quick checks

Notes

  • If a field is unavailable, the method returns None
  • Not intended for high-frequency real-time monitoring
  • Depends on the availability of the mcstatus.io API

License

MIT License — see LICENSE file.


Author

Arpit Jaiswal

GitHub: https://github.com/Arp1it


Contributing

Pull requests, bug reports, and improvements are welcome 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minecraft_server_status-0.0.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minecraft_server_status-0.0.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file minecraft_server_status-0.0.2.tar.gz.

File metadata

  • Download URL: minecraft_server_status-0.0.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for minecraft_server_status-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f0e09a398ce5f9d704dd19a99fa054695b4cf4a66d072ddf51facaf43e853bff
MD5 ba8919605d90104caae96fc6f49d0f4d
BLAKE2b-256 16208bda4cff23022da32e4c72532637cbefbcaa5f7d849c32c2167859b6b123

See more details on using hashes here.

File details

Details for the file minecraft_server_status-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for minecraft_server_status-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0078ef15963358c0bd9f16229a611f238d917dadbc9f2eb40d35b32c4d33ec01
MD5 9de758667b06c14f30ab00a8f107f497
BLAKE2b-256 236f5d88379d594bb7b40d309adcb0e80a7acb244d575d3bab712dd8055e2d5d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page