A simple async API wrapper for the mcsrvstat.us API.
https://pypi.org/project/pymcsrvstatus
| .forgejo/workflows | ||
| .vscode | ||
| LICENSES | ||
| pymcsrvstatus | ||
| .envrc | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| pyproject.toml | ||
| README.md | ||
| renovate.json | ||
| REUSE.toml | ||
| uv.lock | ||
pymcsrvstatus
A simple async API wrapper for the mcsrvstat.us API.
Usage
from pymcsrvstatus import check_if_online, fetch, get_icon_url
import asyncio
async def example(address: str) -> None:
if await check_if_online(address, extra_user_agent="pymcsrvstatus example"):
print("Hypixel is online!")
else:
print("Hypixel is offline!")
status = await fetch(address, extra_user_agent="pymcsrvstatus example")
assert status.online is True
print(status.protocol) # Protocol(version=47, name="1.8.9")
print(status.version) # "Requires MC 1.8 / 1.21"
print(status.players) # Players(online=33812, max=200000, list=None)
print(get_icon_url(address)) # https://api.mcsrvstat.us/icon/hypixel.net
asyncio.run(example(address="hypixel.net"))