Skip to main content
Streaming methods on client.Stream return EventStream<T> (IAsyncEnumerable<T> and IAsyncDisposable). Use await using with await foreach so the HTTP connection closes when you exit the loop.

Filtered and sampled streams

Keep-alive and idle timeout

The X API sends a blank-line heartbeat about every 20 seconds. Set IdleTimeout (e.g., TimeSpan.FromSeconds(60)) and ReconnectOnClose = true on StreamOptions to recover silently stalled or closed connections, and OnKeepAlive to observe heartbeats:

Managing rules

See Build a Rule for rule syntax and operators.