# ZSCORE

> Get the score of a member of a sorted set.

URL: https://docs.hotkv.com/commands/zscore/

```
ZSCORE key member
```

- Group: Sorted set
- Complexity: O(1)
- HotKV Cloud: all plans
- On-Premise: no license needed

`ZSCORE` returns the score of `member` in the sorted set stored at `key`. For
several members at once, use [ZMSCORE](https://docs.hotkv.com/commands/zmscore/index.md).

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Member exists | Bulk string: the score | Double: the score |
| Member or key does not exist | Nil bulk string | Null |

`ZSCORE` replies with a `WRONGTYPE` error if `key` holds a value that is not a
sorted set.

## Examples

```
127.0.0.1:6379> ZADD board 100 "alice" 92.5 "bob"
(integer) 2
127.0.0.1:6379> ZSCORE board "bob"
"92.5"
127.0.0.1:6379> ZSCORE board "nobody"
(nil)
```

## Compatibility

Same as Redis 7.4 and Valkey 8.

## See also

[ZMSCORE](https://docs.hotkv.com/commands/zmscore/index.md), [ZRANK](https://docs.hotkv.com/commands/zrank/index.md), [ZINCRBY](https://docs.hotkv.com/commands/zincrby/index.md),
[ZADD](https://docs.hotkv.com/commands/zadd/index.md)