# community.lexicon.calendar.searchEvents

> Published by [lexicons.lexicon.community](https://lexicon.garden/identity/did:plc:mtr7qrqtcyseedx3jyr5o7db)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mtr7qrqtcyseedx3jyr5o7db/community.lexicon.calendar.searchEvents)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mtr7qrqtcyseedx3jyr5o7db/community.lexicon.calendar.searchEvents/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mtr7qrqtcyseedx3jyr5o7db/community.lexicon.calendar.searchEvents/examples)

## Definitions

### `community.lexicon.calendar.searchEvents`

**Type**: `query`

Search for events. Supports full-text search, filtering by repository, and filtering by location CIDs.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `limit` | `integer` | No | Maximum number of results to return. |
| `query` | `string` | No | Full-text search query. |
| `location` | `array` | No | Filter events by location CIDs. Can be specified multiple times. |
| `repository` | `string` (did) | No | Filter events by DID. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `results` | `array` | Yes |  |

#### Errors

- **InvalidRepository**
- **SearchUnavailable**
- **SearchError**

### `community.lexicon.calendar.searchEvents#eventView`

**Type**: `object`

An event record with RSVP counts and URL.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `url` | `string` (uri) | Yes | The canonical web URL for this event. |
| `countGoing` | `integer` | Yes | Number of users who have RSVP'd as going. |
| `countNotGoing` | `integer` | Yes | Number of users who have RSVP'd as not going. |
| `countInterested` | `integer` | Yes | Number of users who have RSVP'd as interested. |

## Raw Schema

```json
{
  "id": "community.lexicon.calendar.searchEvents",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "InvalidRepository"
        },
        {
          "name": "SearchUnavailable"
        },
        {
          "name": "SearchError"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "results"
          ],
          "properties": {
            "results": {
              "type": "array",
              "items": {
                "ref": "#eventView",
                "type": "ref"
              }
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {
          "limit": {
            "type": "integer",
            "default": 10,
            "maximum": 100,
            "minimum": 1,
            "description": "Maximum number of results to return."
          },
          "query": {
            "type": "string",
            "maxLength": 150,
            "description": "Full-text search query.",
            "maxGraphemes": 150
          },
          "location": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "cid"
            },
            "description": "Filter events by location CIDs. Can be specified multiple times."
          },
          "repository": {
            "type": "string",
            "format": "did",
            "description": "Filter events by DID."
          }
        }
      },
      "description": "Search for events. Supports full-text search, filtering by repository, and filtering by location CIDs."
    },
    "eventView": {
      "type": "object",
      "required": [
        "countGoing",
        "countInterested",
        "countNotGoing",
        "url"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The canonical web URL for this event."
        },
        "countGoing": {
          "type": "integer",
          "description": "Number of users who have RSVP'd as going."
        },
        "countNotGoing": {
          "type": "integer",
          "description": "Number of users who have RSVP'd as not going."
        },
        "countInterested": {
          "type": "integer",
          "description": "Number of users who have RSVP'd as interested."
        }
      },
      "description": "An event record with RSVP counts and URL."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
