> ## Documentation index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Search it with GET https://upstash.com/docs/search?q=<query>.
> Use these to discover all available pages before exploring further.

# ZCARD

> Returns the number of elements in the sorted set stored at key.

## Arguments 

<ParamField body="key" type="str" required>
  The key to get.
</ParamField>

## Response

<ResponseField type="int" required>
    The number of elements in the sorted set.
</ResponseField>

<RequestExample>
```py Example
redis.zadd("myset", {"one": 1, "two": 2, "three": 3})

assert redis.zcard("myset") == 3
```
</RequestExample>
