uiprotect
Python API for Unifi Protect (Unofficial)
What it is and what it does
uiprotect is an async Python library that communicates with UniFi Protect surveillance software running on Ubiquiti hardware (CloudKey+, UNVR, Dream Machine Pro/SE/Pro Max). It exposes both a programmatic API via ProtectApiClient and a command-line interface for managing cameras, events, sensors, lights, and other devices. The library is primarily designed for Home Assistant integration but can be used standalone.
The library increasingly relies on Ubiquiti's official Public Integration API where available, falling back to undocumented private APIs for features not yet exposed officially. It is built entirely on async/await patterns and communicates via WebSocket for real-time updates. Authentication supports both username/password and API-key modes, with public-only mode available for API-key-only workflows. Core dependencies include aiohttp for HTTP, PyAV for audio streaming to speakers, pydantic for data validation, and orjson for fast JSON parsing.
Use it for:
- Integrate UniFi Protect cameras and events into Home Assistant for home automation workflows.
- Build custom monitoring dashboards or alerting systems that consume UniFi Protect events via WebSocket.
- Automate camera settings, recordings, or device management across multiple UniFi Protect instances.
- Export event logs or generate sample data for testing and analysis.
- Develop CLI tools to query NVR status, manage API keys, or control connected devices remotely.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides an async Python API and CLI for interacting with UniFi Protect surveillance systems on Ubiquiti hardware, supporting camera control, event management, and real-time updates via WebSocket.
Yes. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and low install friction. It is production-stable (Development Status 5) and well-suited for Home Assistant users or developers building UniFi Protect integrations. The primary constraint is the requirement for Python 3.11+, a POSIX system, and network access to a UniFi Protect 7.1+ instance; Windows users must use Docker or WSL.
Install
uiprotect on PyPI
pip
pip install uiprotectuv
uv add uiprotectpoetry
poetry add uiprotectInstalling uiprotect
Before you install
Low friction install with a pure-Python wheel. Active maintenance with a recent release (30 days ago) and ongoing commits. Requires Python 3.11+ and a POSIX system; Windows requires Docker or WSL. PyAV dependency adds a compiled component but is pre-packaged.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it suitable for integration into Home Assistant and other projects without licensing concerns.
Quickstart
pip install uiprotect
from uiprotect import ProtectApiClient
protect = ProtectApiClient(host, port, username, password, verify_ssl=True)
await protect.update()
for camera in protect.bootstrap.cameras.values():
print(camera.name)
Requires Python 3.11+, a POSIX-compatible system (not Windows without Docker/WSL), and network access to a UniFi Protect instance running version 7.1 or later.
Verify before relying
- Stability of private API fallback when official Public Integration API does not cover a feature.
- Compatibility across different UniFi OS Console hardware models (CloudKey+, UNVR, Dream Machine variants).
- Performance characteristics under high-frequency WebSocket event loads.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 13 — aiofiles, aiohttp, aiozoneinfo, av, convertertools, orjson, packaging, platformdirs, propcache, pydantic, pydantic-extra-types, pyjwt, yarl |
| Maintenance | actively maintained — 30 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 111,088/month — #12,434 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: uiprotect-15.14.2-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
motioneye-clientAn async Python client library for querying and…
permissive · top 15,000 on PyPI
py-unifi-accessAsync Python client for UniFi Access local API…
permissive · top 15,000 on PyPI
reolink-aioAsync Python client for Reolink IP NVR and…
permissive · top 15,000 on PyPI
aiounifiAsynchronous Python library for communicating…
permissive · top 15,000 on PyPI
blinkpyA Python library for controlling and monitoring…
permissive · top 15,000 on PyPI
unifi-discoveryDiscovers Unifi devices on a network using…
permissive · top 15,000 on PyPI
onvif-zeep-asyncAsync Python client for ONVIF IP cameras using…
permissive · top 15,000 on PyPI
pytapoPyTapo is a Python library that communicates…
permissive · top 15,000 on PyPI
simplisafe-pythonAn async Python interface to the SimpliSafe API…
permissive · top 15,000 on PyPI
total-connect-clientA Python client library for authenticating with…
permissive · top 15,000 on PyPI