> ## Documentation index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Ask it with GET https://upstash.com/docs/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> Feature requests: https://upstash.com/docs/common/help/feature-requests.md lists what users asked for and how to vote for a request or add one.
> Page rating: `GET https://upstash.com/docs/feedback?path=/docs/redis/sdks/ts/commands/stream/xpending&helpful=true` (or `false`) records whether this page helped. An optional `comment` (URL-encoded, at most 500 characters) says what was missing or wrong. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# XPENDING

> Returns information about pending messages in a stream consumer group.

## Arguments

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

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

<ParamField body="start" type="string" required>
  The minimum pending ID to return. Use "-" for the first available ID.
</ParamField>

<ParamField body="end" type="string" required>
  The maximum pending ID to return. Use "+" for the last available ID.
</ParamField>

<ParamField body="count" type="number" required>
  The maximum number of pending messages to return.
</ParamField>

<ParamField body="options">
  <Expandable title="properties">
    <ParamField body="idleTime" type="number">
      Filter by minimum idle time in milliseconds.
    </ParamField>
    <ParamField body="consumer" type="string">
      Filter results by a specific consumer.
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField>
  Returns an array of pending message details.
</ResponseField>

<RequestExample>
```ts Summary
const result = await redis.xpending("mystream", "mygroup", "-", "+", 10);
```

```ts With idle time filter
const result = await redis.xpending("mystream", "mygroup", "-", "+", 5, {
  idleTime: 10000
});
```

```ts Specific consumer filter
const result = await redis.xpending("mystream", "mygroup", "-", "+", 5, {
  consumer: "consumer1"
});
```
</RequestExample>

<ResponseExample>
```ts
[
  2, // total pending count
  "1638360173533-0", // smallest pending ID
  "1638360173533-1", // greatest pending ID
  [
    ["consumer1", "1"], // consumer and their pending count
    ["consumer2", "1"]
  ]
]
```
</ResponseExample>
