A Python wrapper for the Uptime Kuma Socket.IO API https://uptime-kuma-api.readthedocs.io
  • Python 99.4%
  • Makefile 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-02 20:52:05 -04:00
.forgejo/workflows ci(ruff): pass --no-fix so the lint gate can fail in CI 2026-08-02 20:52:05 -04:00
src/uptime_kuma_api feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00
tests feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00
.editorconfig feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00
.gitignore feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00
.python-version feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00
CHANGELOG.md feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00
LICENSE feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00
Makefile feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00
pyproject.toml feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00
README.md feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00
ruff.toml feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00
uv.lock feat!: migrate to uptime kuma 2.x 2026-07-16 13:02:14 -04:00

uptime-kuma-api

A wrapper for the Uptime Kuma Socket.IO API

uptime-kuma-api is a Python wrapper for the Uptime Kuma Socket.IO API.

This is a forked version of uptime-kuma-api for use with Uptime Kuma versions > 2.

Installation

uptime-kuma-api is available on the Python Package Index (PyPI).

You can install it using pip:

pip install uptime-kuma-api

Documentation

The API Reference is available on Read the Docs.

Example

Once you have installed the python package, you can use it to communicate with an Uptime Kuma instance.

To do so, import UptimeKumaApi from the library and specify the Uptime Kuma server url (e.g. 'http://127.0.0.1:3001'), username and password to initialize the connection.

>>> from uptime_kuma_api import UptimeKumaApi, MonitorType
>>> api = UptimeKumaApi('INSERT_URL')
>>> api.login('INSERT_USERNAME', 'INSERT_PASSWORD')

Now you can call one of the existing methods of the instance. For example create a new monitor:

>>> result = api.add_monitor(type=MonitorType.HTTP, name="Google", url="https://google.com")
>>> print(result)
{'msg': 'Added Successfully.', 'monitorId': 1}

At the end, the connection to the API must be disconnected so that the program does not block.

>>> api.disconnect()

With a context manager, the disconnect method is called automatically:

from uptime_kuma_api import UptimeKumaApi

with UptimeKumaApi('INSERT_URL') as api:
    api.login('INSERT_USERNAME', 'INSERT_PASSWORD')
    api.add_monitor(
        type=MonitorType.HTTP,
        name="Google",
        url="https://google.com"
    )