> ## Documentation Index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# XINFO

> Returns information about streams, consumer groups, and consumers.

## Arguments

<ParamField body="key" type="string" required>
  The key of the stream.
</ParamField>

<ParamField body="options" type="object" required>
  The XINFO subcommand options. Can be one of:

  <Expandable title="GROUPS">
    <ParamField body="type" type="'GROUPS'" required>
      List all consumer groups for the stream.
    </ParamField>
  </Expandable>

  <Expandable title="CONSUMERS">
    <ParamField body="type" type="'CONSUMERS'" required>
      List all consumers in a consumer group.
    </ParamField>

    <ParamField body="group" type="string" required>
      The consumer group name.
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField>
  The return type depends on the subcommand:

  * GROUPS: Returns an array of consumer group information
  * CONSUMERS: Returns an array of consumer information
</ResponseField>

<RequestExample>
  ```ts List groups theme={"system"}
  const result = await redis.xinfo("mystream", {
    type: "GROUPS"
  });
  ```

  ```ts List consumers theme={"system"}
  const result = await redis.xinfo("mystream", {
    type: "CONSUMERS",
    group: "mygroup"
  });
  ```
</RequestExample>

<ResponseExample>
  ```ts theme={"system"}
  // GROUPS response
  [
    {
      name: "mygroup",
      consumers: 2,
      pending: 1,
      "last-delivered-id": "1638360173533-2",
      "entries-read": 3,
      lag: 2
    }
  ]

  // CONSUMERS response
  [
    {
      name: "consumer1",
      pending: 1,
      idle: 15000,
      "inactive": 15000
    }
  ]
  ```
</ResponseExample>
