Skip to main content
The network query tools give you full visibility into how your UniFi site is segmented — which VLANs exist, how subnets are configured, and how traffic is distributed across networks. All four tools are read-only and can be called at any time without affecting your network configuration.

list_vlans

Returns all network configurations on a site. Despite the name, this tool returns every network — not just those with an explicit VLAN ID — because the local gateway API does not always populate vlan_id for every network type.

Parameters

string
required
The site identifier. Use "default" for single-site deployments.
number
default:"100"
Maximum number of networks to return.
number
default:"0"
Number of networks to skip. Use with limit for pagination across large site configurations.

Response

Returns an array of network objects.

Example response


get_network_details

Returns the full configuration record for a single network identified by its ID.

Parameters

string
required
The site identifier.
string
required
The network’s unique identifier. Use list_vlans to discover network IDs.

Response

Returns a single network object with the same fields as list_vlans, plus any additional configuration fields stored for that network.

Example response

If the network ID does not exist on the site, the tool raises ResourceNotFoundError. Network IDs are site-scoped — an ID from one site is not valid on another.

get_subnet_info

Returns detailed subnet and DHCP configuration for a single network. This is more focused than get_network_details and is specifically useful when you need to inspect DHCP range, lease time, DNS servers, or gateway settings.

Parameters

string
required
The site identifier.
string
required
The network’s unique identifier.

Response

string
The network identifier that was queried.
string
Network name.
string
Subnet in CIDR notation.
number
VLAN tag number. May be null for the default LAN.
boolean
Whether the UniFi DHCP server is enabled for this network.
string
First IP address in the DHCP lease range.
string
Last IP address in the DHCP lease range.
number
DHCP lease duration in seconds.
string
Primary DNS server address pushed to DHCP clients.
string
Secondary DNS server address.
string
Tertiary DNS server address.
string
Quaternary DNS server address.
string
Gateway IP address pushed to DHCP clients.
string
Local domain name pushed to DHCP clients, for example local.

Example response


get_network_statistics

Returns traffic and client usage statistics aggregated per network for an entire site. Useful for identifying which VLANs are busiest and how many clients are on each segment.

Parameters

string
required
The site identifier. This tool returns statistics for all networks on the site.

Response

string
The site that was queried.
object[]
Array of per-network statistics objects.

Example response

Client counts in get_network_statistics are calculated from the active client table by matching each client’s vlan field to the network’s vlan_id. If you see zero clients on a network you know has devices, verify that the VLAN ID is correctly set on both the network and the switch ports.