A simple async API wrapper for the mcsrvstat.us API. https://pypi.org/project/pymcsrvstatus
Find a file
Renovate 17ca012459
All checks were successful
Actions / Build (push) Successful in 15s
Actions / Lint (Python 3.10) (push) Successful in 17s
Actions / Lint (Python 3.11) (push) Successful in 37s
Actions / Lint (Python 3.9) (push) Successful in 38s
Merge pull request 'chore(deps): update catthehacker/ubuntu:act-latest docker digest to fa8a60b' (#46) from renovate/catthehacker-ubuntu-act-latest into main
2025-12-08 09:05:33 -05:00
.forgejo/workflows chore(deps): update catthehacker/ubuntu:act-latest docker digest to fa8a60b 2025-12-08 14:05:15 +00:00
.vscode init @ 1.0.0 2025-06-29 07:25:45 -05:00
LICENSES REUSE Compliance 2025-09-28 09:15:11 -05:00
pymcsrvstatus REUSE Compliance 2025-09-28 09:15:11 -05:00
.envrc REUSE Compliance 2025-09-28 09:15:11 -05:00
.gitignore REUSE Compliance 2025-09-28 09:15:11 -05:00
flake.lock flake: init 2025-06-28 19:49:19 -05:00
flake.nix REUSE Compliance 2025-09-28 09:15:11 -05:00
pyproject.toml REUSE Compliance 2025-09-28 09:15:11 -05:00
README.md REUSE Compliance 2025-09-28 09:15:11 -05:00
renovate.json chore: Configure Renovate (#1) 2025-06-29 08:33:58 -05:00
REUSE.toml REUSE Compliance 2025-09-28 09:15:11 -05:00
uv.lock chore(deps): lock file maintenance 2025-12-08 00:06:14 +00:00

pymcsrvstatus

Discord Actions Status PyPI - Version PyPI - Python Version PyPI - License

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"))