{
  "id": "json.get",
  "title": "JSON.GET",
  "url": "https://redis.io/docs/latest/commands/json.get/",
  "summary": "Gets the value at one or more paths in JSON serialized form",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-04-09T10:29:34-04:00",
  "page_type": "content",
  "content_hash": "3bf64c7c5f6c75cfb6abd940c04a97e7600b11f35c057286f118d3fd9b4f92a7",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Return the value at `path` in JSON serialized form\n\n[Examples](#examples)"
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary> \n\nis key to parse.\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>path</code></summary> \n\nis JSONPath to specify. Default is root `$`. JSON.GET accepts multiple `path` arguments.\n\n\n\nWhen using a single JSONPath, the root of the matching values is a JSON string with a top-level **array** of serialized JSON value. \nIn contrast, a legacy path returns a single value.\n\nWhen using multiple JSONPath arguments, the root of the matching values is a JSON string with a top-level **object**, with each object value being a top-level array of serialized JSON value.\nIn contrast, if all paths are legacy paths, each object value is a single serialized JSON value.\nIf there are multiple paths that include both legacy path and JSONPath, the returned value conforms to the JSONPath version (an array of values).\n\n\n\n</details>\n\n<details open><summary><code>INDENT</code></summary> \n\nsets the indentation string for nested levels.\n</details>\n\n<details open><summary><code>NEWLINE</code></summary> \n\nsets the string that's printed at the end of each line.\n</details>\n\n<details open><summary><code>SPACE</code></summary> \n\nsets the string that's put between a key and a value.\n</details>\n \nProduce pretty-formatted JSON with `redis-cli` by following this example:\n\n\n~/$ redis-cli --raw\nredis> JSON.GET myjsonkey INDENT \"\\t\" NEWLINE \"\\n\" SPACE \" \" path.to.value[1]"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "<details open>\n<summary><b>Return the value at <code>path</code> in JSON serialized form</b></summary>\n\nCreate a JSON document.\n\n\nredis> JSON.SET doc $ '{\"a\":2, \"b\": 3, \"nested\": {\"a\": 4, \"b\": null}}'\nOK\n\n\nWith a single JSONPath (JSON array bulk string):\n\n\nredis>  JSON.GET doc $..b\n\"[3,null]\"\n\n\nUsing multiple paths with at least one JSONPath returns a JSON string with a top-level object with an array of JSON values per path:\n\n\nredis> JSON.GET doc ..a $..b\n\"{\\\"$..b\\\":[3,null],\\\"..a\\\":[2,4]}\"\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; Supported</span><br /> | <span title=\"Supported\">&#x2705; Flexible & Annual</span><br /><span title=\"Supported\">&#x2705; Free & Fixed</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Bulk string reply](): a JSON-encoded string representing the value(s) at the specified path(s).\n\nWith a single path, returns the JSON serialization of the value at that path.\nWith multiple paths, returns a JSON object where each key is a path and each value is an array of JSON serializations.\n\n**RESP3:**\n\n[Bulk string reply](): a JSON-encoded string with a top-level array containing the value(s) at the specified path(s).\n\nWith a single path using `$` (default in RESP3), returns a JSON array containing the serialized value.\nWith multiple paths, returns a JSON object where each key is a path and each value is an array of JSON serializations."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`JSON.SET`]() | [`JSON.MGET`]()"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "* [RedisJSON]()\n* [Index and search JSON documents]()"
    }
  ],
  "examples": []
}
