Canonical: https://weaveos.com/reference/upstash-redis/read-a-redis-string-key

1. [Software capabilities](https://weaveos.com/reference)
2. /[Upstash Redis](https://weaveos.com/reference/upstash-redis)
3. /Read one Upstash Redis string key

[![](https://weaveos.com/reference/logos/upstash-redis.png)Upstash Redis](https://weaveos.com/reference/upstash-redis)

# Read one Upstash Redis string key

Upstash supports a non-mutating GET through its serverless SDK or native Redis protocol. Use the SDK for serverless JavaScript and redis-cli for a direct TLS terminal connection.

Documentation reviewed November 27, 2026 · 2 methods with sources

## Ways to do it

1. [1SDK: @upstash/redis Redis.fromEnv().get](https://weaveos.com/reference/upstash-redis/read-a-redis-string-key#method-1)
2. [2CLI: redis-cli --tls get](https://weaveos.com/reference/upstash-redis/read-a-redis-string-key#method-2)

SDK

### @upstash/redis Redis.fromEnv().get

Create the serverless Redis client from UPSTASH\_REDIS\_REST\_URL and UPSTASH\_REDIS\_REST\_TOKEN, then call get for one key.

[Read source: Upstash Redis GET command](https://upstash.com/docs/redis/commands/string/get)

- Requirements

  A provisioned Upstash Redis database and the UPSTASH\_REDIS\_REST\_URL and UPSTASH\_REDIS\_REST\_TOKEN environment variables.

- Limitations

  GET returns null when a key does not exist and errors when the key contains a non-string type such as a hash or list.

Example text

Copy

```
import { Redis } from "@upstash/redis";
const redis = Redis.fromEnv();
const value = await redis.get("profile:42");
```

CLI

### redis-cli --tls get

Connect over Upstash's native Redis TCP protocol with TLS and issue the GET command from a terminal.

[Read source: Upstash redis-cli connection guide](https://upstash.com/docs/redis/howto/redis-cli)

- Requirements

  redis-cli installed, the Upstash endpoint, port, and token from the database Details tab, and TLS enabled with --tls or a rediss\:// URL.

- Limitations

  Upstash requires TLS on every database. Omitting --tls or using redis\:// causes the connection to fail.

Example shell

Copy

```
REDISCLI_AUTH="$UPSTASH_REDIS_TOKEN" redis-cli --tls -h "$UPSTASH_REDIS_ENDPOINT" -p "$UPSTASH_REDIS_PORT" get profile:42
```

## More from Upstash Redis

[View all 1 Upstash Redis tasks](https://weaveos.com/reference/upstash-redis)
