# Source: https://upstash.com/docs/redis/sdks/ts/commands/set/sscan.md

# Source: https://upstash.com/docs/redis/sdks/py/commands/set/sscan.md

> ## 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.

# SSCAN

> Scan a set

## Arguments

<ParamField body="key" type="str" required>
  The key of the set.
</ParamField>

<ParamField body="cursor" type="number">
  The cursor, use `0` in the beginning and then use the returned cursor for subsequent calls.
</ParamField>

<ParamField body="options" type="Object">
  <ParamField body="match" type="str">
    Glob-style pattern to filter by members.
  </ParamField>

  <ParamField body="count" type="number">
    Number of members to return per call.
  </ParamField>
</ParamField>

## Response

<ResponseField type="Tuple[number, TMember[]]" required>
  The new cursor and the members.
  If the new cursor is `0` the iteration is complete.
</ResponseField>

<RequestExample>
  ```py Example theme={"system"}
  # Get all members of a set.

  cursor = 0
  results = set()

  while True:
      cursor, keys = redis.sscan("myset", cursor, match="*")

      results.extend(keys)
      if cursor == 0:
          break
  ```
</RequestExample>