> ## 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/py/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="str" required>
  The key of the stream.
</ParamField>

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

<ParamField body="start" type="str">
  The minimum pending ID to return (use with end and count).
</ParamField>

<ParamField body="end" type="str">
  The maximum pending ID to return (use with start and count).
</ParamField>

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

<ParamField body="consumer" type="str">
  Filter results by a specific consumer.
</ParamField>

<ParamField body="idle" type="int">
  Filter by minimum idle time in milliseconds.
</ParamField>

## Response

<ResponseField type="Any">
  When called without range arguments, returns a summary with total count and range info.
  When called with range arguments, returns detailed pending message information.
</ResponseField>

<RequestExample>
```py Summary
result = redis.xpending("mystream", "mygroup")
```

```py Detailed with range
result = redis.xpending("mystream", "mygroup", start="-", end="+", count=10)
```

```py Specific consumer with idle filter
result = redis.xpending("mystream", "mygroup", start="-", end="+", count=5, consumer="consumer1", idle=10000)
```
</RequestExample>

<ResponseExample>
```py
[
  2,  # total pending count
  "1638360173533-0",  # smallest pending ID
  "1638360173533-1",  # greatest pending ID
  [["consumer1", "2"]]  # consumers and their pending counts
]
```
</ResponseExample>
