{
  "schema_version": 2,
  "id": "commands/object-refcount",
  "title": "OBJECT REFCOUNT",
  "url": "https://redis.io/docs/latest/commands/object-refcount/",
  "summary": "Returns the reference count of a value of a key.",
  "since": "2.2.3",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-06-15T06:26:34-07:00",
  "page_type": "content",
  "content_hash": "6d9b7b7d117fda12bceaec646ad2efa1e5d4c14ff157943cc5e940d08f301aef",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "This command returns the reference count of the stored at `key`."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key.\n\n</details>"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n[Integer reply](../../develop/reference/protocol-spec#integers): the number of references.\n[Nil reply](../../develop/reference/protocol-spec#bulk-strings): if _key_ doesn't exist.\n\n**RESP3:**\n\nOne of the following:\n[Integer reply](../../develop/reference/protocol-spec#integers): the number of references.\n[Null reply](../../develop/reference/protocol-spec#nulls): if _key_ doesn't exist."
    }
  ],
  "examples": []
}
