{
  "schema_version": 2,
  "id": "commands/georadius",
  "title": "GEORADIUS",
  "url": "https://redis.io/docs/latest/commands/georadius/",
  "summary": "Queries a geospatial index for members within a distance from a coordinate, optionally stores the result.",
  "since": "3.2.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:43+01:00",
  "page_type": "content",
  "content_hash": "f349ce70952b129d58b4319d6aa25da52fe38bb733ce8d1a5ebeaf6523858a68",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "> [!NOTE]\n> This command's behavior varies in clustered Redis environments. See the [multi-key operations](https://redis.io/docs/latest/develop/using-commands/multi-key-operations) page for more information.\n\n\nReturn the members of a sorted set populated with geospatial information using [`GEOADD`](https://redis.io/docs/latest/commands/geoadd), which are within the borders of the area specified with the center location and the maximum distance from the center (the radius).\n\nThis manual page also covers the [`GEORADIUS_RO`](https://redis.io/docs/latest/commands/georadius_ro) and [`GEORADIUSBYMEMBER_RO`](https://redis.io/docs/latest/commands/georadiusbymember_ro) variants (see the section below for more information).\n\nThe common use case for this command is to retrieve geospatial items near a specified point not farther than a given amount of meters (or other units). This allows, for example, to suggest mobile users of an application nearby places.\n\nThe radius is specified in one of the following units:\n\n* **m** for meters.\n* **km** for kilometers.\n* **mi** for miles.\n* **ft** for feet.\n\nThe command optionally returns additional information using the following options:\n\n* `WITHDIST`: Also return the distance of the returned items from the specified center. The distance is returned in the same unit as the unit specified as the radius argument of the command.\n* `WITHCOORD`: Also return the longitude,latitude coordinates of the matching items.\n* `WITHHASH`: Also return the raw geohash-encoded sorted set score of the item, in the form of a 52 bit unsigned integer. This is only useful for low level hacks or debugging and is otherwise of little interest for the general user.\n\nThe command default is to return unsorted items. Two different sorting methods can be invoked using the following two options:\n\n* `ASC`: Sort returned items from the nearest to the farthest, relative to the center.\n* `DESC`: Sort returned items from the farthest to the nearest, relative to the center.\n\nBy default all the matching items are returned. It is possible to limit the results to the first N matching items by using the **COUNT `<count>`** option.\nWhen `ANY` is provided the command will return as soon as enough matches are found,\nso the results may not be the ones closest to the specified point, but on the other hand, the effort invested by the server is significantly lower.\nWhen `ANY` is not provided, the command will perform an effort that is proportional to the number of items matching the specified area and sort them,\nso to query very large areas with a very small `COUNT` option may be slow even if just a few results are returned.\n\nBy default the command returns the items to the client. It is possible to store the results with one of these options:\n\n* `STORE`: Store the items in a sorted set populated with their geospatial information.\n* `STOREDIST`: Store the items in a sorted set populated with their distance from the center as a floating point number, in the same unit specified in the radius."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key that holds the geospatial index (a sorted set).\n\n</details>\n\n<details open><summary><code>longitude</code></summary>\n\nThe longitude of the center point.\n\n</details>\n\n<details open><summary><code>latitude</code></summary>\n\nThe latitude of the center point.\n\n</details>\n\n<details open><summary><code>radius</code></summary>\n\nThe radius of the search circle, in the unit given by the following argument.\n\n</details>\n\n<details open><summary><code>M | KM | FT | MI</code></summary>\n\nThe unit for `radius`: meters (`M`), kilometers (`KM`), feet (`FT`), or miles (`MI`).\n\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>WITHCOORD</code></summary>\n\nAlso return the longitude and latitude of each matching item.\n\n</details>\n\n<details open><summary><code>WITHDIST</code></summary>\n\nAlso return the distance of each matching item from the center, in the same unit as the radius.\n\n</details>\n\n<details open><summary><code>WITHHASH</code></summary>\n\nAlso return the raw 52-bit geohash-encoded score of each matching item.\n\n</details>\n\n<details open><summary><code>COUNT count [ANY]</code></summary>\n\nReturn at most `count` matches. With `ANY`, the command returns as soon as enough matches are found — faster, but the results may be unsorted.\n\n</details>\n\n<details open><summary><code>ASC | DESC</code></summary>\n\nSort the results by distance from the center: nearest first (`ASC`) or farthest first (`DESC`).\n\n</details>\n\n<details open><summary><code>STORE key</code></summary>\n\nStore the results as a geospatial index in `key` instead of returning them. `STORE` and `STOREDIST` are mutually exclusive.\n\n</details>\n\n<details open><summary><code>STOREDIST key</code></summary>\n\nStore the results in `key` as a sorted set of distances from the center, instead of returning them.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> GEOADD Sicily 13.361389 38.115556 \"Palermo\" 15.087269 37.502669 \"Catania\"\n(integer) 2\nredis> GEORADIUS Sicily 15 37 200 km WITHDIST\n1) 1) \"Palermo\"\n   2) \"190.4424\"\n2) 1) \"Catania\"\n   2) \"56.4413\"\nredis> GEORADIUS Sicily 15 37 200 km WITHCOORD\n1) 1) \"Palermo\"\n   2) 1) \"13.361389338970184\"\n      2) \"38.1155563954963\"\n2) 1) \"Catania\"\n   2) 1) \"15.087267458438873\"\n      2) \"37.50266842333162\"\nredis> GEORADIUS Sicily 15 37 200 km WITHDIST WITHCOORD\n1) 1) \"Palermo\"\n   2) \"190.4424\"\n   3) 1) \"13.361389338970184\"\n      2) \"38.1155563954963\"\n2) 1) \"Catania\"\n   2) \"56.4413\"\n   3) 1) \"15.087267458438873\"\n      2) \"37.50266842333162\""
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": ""
    },
    {
      "id": "read-only-variants",
      "title": "Read-only variants",
      "role": "content",
      "text": "Since `GEORADIUS` and [`GEORADIUSBYMEMBER`](https://redis.io/docs/latest/commands/georadiusbymember) have a `STORE` and `STOREDIST` option they are technically flagged as writing commands in the Redis command table. For this reason read-only replicas will flag them, and Redis Cluster replicas will redirect them to the master instance even if the connection is in read-only mode (see the [`READONLY`](https://redis.io/docs/latest/commands/readonly) command of Redis Cluster).\n\nBreaking the compatibility with the past was considered but rejected, at least for Redis 4.0, so instead two read-only variants of the commands were added. They are exactly like the original commands but refuse the `STORE` and `STOREDIST` options. The two variants are called [`GEORADIUS_RO`](https://redis.io/docs/latest/commands/georadius_ro) and [`GEORADIUSBYMEMBER_RO`](https://redis.io/docs/latest/commands/georadiusbymember_ro), and can safely be used in replicas."
    },
    {
      "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> | Deprecated as of Redis v6.2.0. |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* If no `WITH*` option is specified, an [Array reply](../../develop/reference/protocol-spec#arrays) of matched member names\n* If `WITHCOORD`, `WITHDIST`, or `WITHHASH` options are specified, the command returns an [Array reply](../../develop/reference/protocol-spec#arrays) of arrays, where each sub-array represents a single item:\n    1. The distance from the center as a floating point number, in the same unit specified in the radius.\n    1. The Geohash integer.\n    1. The coordinates as a two items x,y array (longitude,latitude).\nFor example, the command `GEORADIUS Sicily 15 37 200 km WITHCOORD WITHDIST` will return each item in the following way:\n`[\"Palermo\",\"190.4424\",[\"13.361389338970184\",\"38.115556395496299\"]]`\n\n**RESP3:**\n\nOne of the following:\n* If no `WITH*` option is specified, an [Array reply](../../develop/reference/protocol-spec#arrays) of matched member names\n* If `WITHCOORD`, `WITHDIST`, or `WITHHASH` options are specified, the command returns an [Array reply](../../develop/reference/protocol-spec#arrays) of arrays, where each sub-array represents a single item:\n    1. The distance from the center as a floating point number, in the same unit specified in the radius.\n    1. The Geohash integer.\n    1. The coordinates as a two items x,y array (longitude,latitude).\nFor example, the command `GEORADIUS Sicily 15 37 200 km WITHCOORD WITHDIST` will return each item in the following way:\n`[\"Palermo\",\"190.4424\",[\"13.361389338970184\",\"38.115556395496299\"]]`"
    }
  ],
  "examples": []
}
