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.6

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.6
File Size Uploaded
unifi_sm_api-0.2.6.tar.gz 18.2 kB Details

Built distribution (wheel)

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

Total release size: 36.2 kB

Release files / unifi_sm_api-0.2.6.tar.gz

Download URL unifi_sm_api-0.2.6.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b99a4ac05738becb6bc866f5ec645b3471a99718b60168191a1e2d213a445799
BLAKE2b-256 checksum
How to use checksums
a3dee621791bfbc46c9c5cb7576a037c69c944ad0b124005510f63e888d0fe05
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.6-py3-none-any.whl

Download URL unifi_sm_api-0.2.6-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c4abc0fb2c84e3780fbc2f2298292babf5094e2bc9d9a483d4183d35546ee41
BLAKE2b-256 checksum
How to use checksums
87904d0ac0b4f0b6f7db081ab73e6909ad319f65632e225a3b19c3112961a9c7
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

This release

0.2.6 This release

2 release files

0.2.5

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