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
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-channelGet occupancy in JSON format:
ably channels occupancy get my-channel --jsonGet occupancy in formatted JSON output:
ably channels occupancy get my-channel --pretty-jsonGet occupancy using an API key environment variable:
ABLY_API_KEY="YOUR_API_KEY" ably channels occupancy get my-channelSee also
- Channels — Explore all
ably channelscommands. - CLI reference — Full list of available commands.