> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-dx-3009-array-sdk-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 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 theme={"system"}
  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.
