# ARLEN

> Get the highest occupied array index plus one.

Use [ARCOUNT](./arcount) to count stored values.

## Arguments

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

## Response

<ResponseField type="int" required>
  The highest occupied index plus one. A missing key returns `"0"` in TypeScript or `0` in Python. TypeScript returns a string even for small lengths.
</ResponseField>

<RequestExample>
```py Example
redis.arset("readings", 1000, "sample")
print(redis.arlen("readings"))  # 1001
print(redis.arcount("readings"))  # 1
```
</RequestExample>

See the [server command reference](/redis/commands/array/arlen) for protocol details.
