Skip to content
masterclass Buddy

Upstash · Method

redis.ttl

Use redis.ttl(key) to read the remaining lifetime of a Redis key in seconds. The result is negative when the key does not exist or has no expiration.

Last updated

Syntax

redis.ttl(key)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • EXPIRE
  • EXPIREAT
  • PERSIST
  • PTTL

Source: TTL - Upstash Documentation. Checked 2026-11-03.