> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neynar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Events API

> gRPC API for subscribing to real-time event updates from Snapchain nodes

Used to subscribe to real-time event updates from the Snapchain node

## API

| Method Name | Request Type     | Response Type   | Description                        |
| ----------- | ---------------- | --------------- | ---------------------------------- |
| Subscribe   | SubscribeRequest | stream HubEvent | Streams new Events as they occur   |
| GetEvent    | EventRequest     | HubEvent        | Returns a single event by ID       |
| GetEvents   | EventsRequest    | EventsResponse  | Returns a paginated list of events |

## SubscribeRequest

| Field        | Type         | Label    | Description                      |
| ------------ | ------------ | -------- | -------------------------------- |
| event\_types | HubEventType | repeated | Types of events to subscribe to  |
| from\_id     | uint64       | optional | Event ID to start streaming from |
| shard\_index | uint32       | optional | Shard index to subscribe to      |

## EventRequest

| Field        | Type   | Label | Description               |
| ------------ | ------ | ----- | ------------------------- |
| id           | uint64 |       | Event ID to retrieve      |
| shard\_index | uint32 |       | Shard index for the event |

## EventsRequest

| Field        | Type   | Label    | Description                               |
| ------------ | ------ | -------- | ----------------------------------------- |
| start\_id    | uint64 |          | Starting event ID                         |
| shard\_index | uint32 | optional | Shard index to query                      |
| stop\_id     | uint64 | optional | Stopping event ID                         |
| page\_size   | uint32 | optional | Number of events to return per page       |
| page\_token  | bytes  | optional | Page token for pagination                 |
| reverse      | bool   | optional | Whether to return events in reverse order |

## EventsResponse

| Field             | Type     | Label    | Description                    |
| ----------------- | -------- | -------- | ------------------------------ |
| events            | HubEvent | repeated | List of events                 |
| next\_page\_token | bytes    | optional | Token for next page of results |
