> For the complete documentation index, see [llms.txt](https://docs.chainrpc.io/chainrpc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chainrpc.io/chainrpc/networks/ethereum/how-to/subscribe-to-events.md).

# Subscribe to events

Subscribe to events with the WebSocket [subscription methods](/chainrpc/networks/ethereum/json-rpc-methods/subscription-methods.md).

Subscription is only available over stateful transports such as WebSocket. Subscription requests cannot be made over HTTPS.

### Example event subscription

The following WebSocket subscription example fires a notification each time a new header is appended to the chain:

```bash
$ wscat -c wss://eth.chainrpc.io/v3/YOUR-API-KEY
> {"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}
```
