Skip to main content
The site query tools give you visibility into all UniFi sites your API key has access to. In single-site deployments you will typically deal with one site named "default", but these tools become essential in multi-site environments where you need to discover site identifiers before calling device or network tools. All three tools are read-only.

list_sites

Returns all sites accessible with your configured API key. The tool automatically selects the correct API endpoint based on whether you are using the local gateway or cloud API.

Parameters

number
default:"100"
Maximum number of sites to return.
number
default:"0"
Number of sites to skip for pagination across large multi-site organizations.

Response

Returns an array of site objects.

Example response


get_site_details

Returns the full record for a single site. You can look up a site by its _id, by its name, or by its internalReference — the tool checks all three fields.

Parameters

string
required
The site identifier. Accepted values:
  • The site’s _id (for example, "507f1f77bcf86cd799439011")
  • The site’s name (for example, "Home")
  • The site’s internalReference string
  • "default" for the primary site on local gateway deployments

Response

Returns a single site object with the same fields as list_sites.

Example response

If no site matches the provided site_id, the tool raises ResourceNotFoundError. Double-check the value against list_sites output if you receive this error.

get_site_statistics

Returns a comprehensive summary of site health — device counts by type, online/offline status, client counts by connection type, network count, and total bandwidth consumed across all clients.

Parameters

string
required
The site identifier.

Response

string
The site that was queried.
object
Device inventory summary.
object
Active client summary.
object
object
Aggregate bandwidth across all active clients.

Example response

get_site_statistics gathers data from three separate API endpoints (devices, active clients, and networks) in a single call, making it the most efficient way to get a site health snapshot. Use it as a starting point before drilling into specific devices or clients.