Skip to main content

UniFi Site Manager API Client

Python library for interacting with UniFi’s Site Manager Integration API. Tested on a selfhosted local instance only. Downlod from here: https://pypi.org/project/unifi-sm-api/

[!NOTE] This library was mainly creted to be used with NetAlertX, as such, full API coverage is not planned. PRs are however more than welcome.

📦 Usage

Navigate to Site Manager ⚙️ Settings -> Control Plane -> Integrations.

  • api_key : You can generate your API key under the Your API Keys section.
  • base_url : You can find your base url in the API Request Format section.
  • version : You can find your version as part of the url in the API Request Format section.
from unifi_sm_api.api import SiteManagerAPI

api = SiteManagerAPI(
    api_key="fakeApiKey1234567890",
    base_url="https://192.168.100.1/proxy/network/integration/",
    version="v1",
    verify_ssl=False
)

sites = api.get_sites()

for site in sites:
    site_id = site["id"]

    unifi_devices = api.get_unifi_devices(site_id=site_id)
    clients = api.get_clients(site_id=site_id)

📘 Endpoints Covered

  • /sites — list available sites
  • /sites/{site_id}/devices — list UniFi devices for a site
  • /sites/{site_id}/clients — list connected clients
  • /sites/{site_id}/wans

🔧 Requirements

  • Python 3.8+
  • requests
  • pytest (for running tests)
  • Local .env file with API credentials

Testing

🌍 Environment Setup

Create a .env file in the project root with the following:

API_KEY=fakeApiKey1234567890
BASE_URL=https://192.168.100.1/proxy/network/integration/
VERSION=v1
VERIFY_SSL=False

🧪 Running Tests

Make sure PYTHONPATH includes the project root, then run:

python3 -m venv venv && source venv/bin/activate
pip install pytest python-dotenv
cd unifi-sm-api/
pip install -e .
PYTHONPATH=.. pytest -s tests/test_api.py

💙 Donations

Metadata

Release files for unifi-sm-api 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unifi-sm-api 0.2.5
File Size Uploaded
unifi_sm_api-0.2.5.tar.gz 18.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unifi-sm-api 0.2.5
File Interpreter ABI Platform
unifi_sm_api-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 36.0 kB

Release files / unifi_sm_api-0.2.5.tar.gz

Download URL unifi_sm_api-0.2.5.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
af0b19a32c172c97a20935795b4f3158ce76a7386eca17db4b61a6cf1ea32c22
BLAKE2b-256 checksum
How to use checksums
b3a3fa0d331d5b33828a13ffca243573e6b7e78604a5250bcdb3021519ef1f5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.

Transparency log

Release files / unifi_sm_api-0.2.5-py3-none-any.whl

Download URL unifi_sm_api-0.2.5-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0a93263e2770cc459312a8566c2f0834ad140d4cab0dc9aaeb0c0c69ad71825
BLAKE2b-256 checksum
How to use checksums
a7708b088571da4c9f07c25ed12fe474813c447ba1bcc60fa79d5410dd0c1f65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.6

2 release files

This release

0.2.5 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page