# com.getorbyt.community.listCommunities

> Published by [getorbyt.com](https://lexicon.garden/identity/did:plc:2xrqztnmzlckb3xfuuukupso)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:2xrqztnmzlckb3xfuuukupso/com.getorbyt.community.listCommunities)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2xrqztnmzlckb3xfuuukupso/com.getorbyt.community.listCommunities/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2xrqztnmzlckb3xfuuukupso/com.getorbyt.community.listCommunities/examples)

## Definitions

### `com.getorbyt.community.listCommunities`

**Type**: `query`

The public Community directory. Unauthenticated; an authenticated request additionally receives viewer state on each Community.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `sort` | `string` | No |  |
| `limit` | `integer` | No |  |
| `query` | `string` | No |  |
| `cursor` | `string` | No |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cursor` | `string` | No |  |
| `communities` | `array` | Yes |  |

#### Errors

- **InvalidCursor**

## Raw Schema

```json
{
  "id": "com.getorbyt.community.listCommunities",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "InvalidCursor"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "communities"
          ],
          "properties": {
            "cursor": {
              "type": "string"
            },
            "communities": {
              "type": "array",
              "items": {
                "ref": "com.getorbyt.community.defs#view",
                "type": "ref"
              },
              "maxLength": 50
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {
          "sort": {
            "type": "string",
            "knownValues": [
              "popular",
              "new"
            ]
          },
          "limit": {
            "type": "integer",
            "default": 25,
            "maximum": 50,
            "minimum": 1
          },
          "query": {
            "type": "string",
            "maxLength": 100
          },
          "cursor": {
            "type": "string"
          }
        }
      },
      "description": "The public Community directory. Unauthenticated; an authenticated request additionally receives viewer state on each Community."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
