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.1.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.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: minecraft_server_status-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 e867850b7fd4971aa5889779b60590e3489c63b53c86375d39041c971991e7ef
MD5 7b9d11447849d0c0d5eb308d3223f3d6
BLAKE2b-256 94bdf092ce5d6895af7b20cd1642b7300fe0491e1d5c91fc5cab366fe3043f0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for minecraft_server_status-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7736503461a3822c71cf79bed7da5f17b080d5f8ad48d76d8a7ebc6716e1e4d7
MD5 20b141b6e30a2684ebbd62d594b7241e
BLAKE2b-256 aa269c059a5826833f95c5124853f0750a0dd4cdf937e7effc778ee6991534d6

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