Channels occupancy get

Open in

Use the ably channels occupancy get command to get the current occupancy for an Ably Pub/Sub channel.

Synopsis

ably channels occupancy get <channel-name> [options]

Arguments

channel-name
Required

The name of the channel to get occupancy for.

Options

--json

Output results as compact JSON. Mutually exclusive with --pretty-json.

--pretty-json

Output results in formatted JSON. Mutually exclusive with --json.

--verbose | -v

Enable verbose logging. Can be combined with --json or --pretty-json.

Examples

Get the current occupancy for a channel:

ably channels occupancy get my-channel

Get occupancy in JSON format:

ably channels occupancy get my-channel --json

Get occupancy in formatted JSON output:

ably channels occupancy get my-channel --pretty-json

Get occupancy using an API key environment variable:

ABLY_API_KEY="YOUR_API_KEY" ably channels occupancy get my-channel

See also

  • Channels — Explore all ably channels commands.
  • CLI reference — Full list of available commands.