Filtered Stream prioritizes data hydration and delivery, with approximately 6-7 seconds of P99 latency. For lower latency requirements, see Powerstream.
Overview
Near real-time delivery
Receive Posts within seconds of publication
Persistent rules
Add and remove rules without disconnecting
Powerful operators
Match on keywords, hashtags, users, and more
Webhook delivery
Optionally receive Posts via webhooks
How it works
- Create rules — Define filter rules using operators
- Connect to stream — Establish a persistent HTTP connection
- Receive Posts — Get matching Posts in near real-time
Endpoints
Access levels
Contact for Enterprise
Get higher limits and additional features
Building rules
Rules use the same operators as search queries:Example rules
Build a rule
Learn rule syntax and operators
Connecting to the stream
Establish a persistent HTTP connection to receive Posts:Keep-alive signals
The stream sends blank lines (\r\n) every 20 seconds to maintain the connection. If you don’t receive data or a keep-alive for 20 seconds, reconnect.
Handling disconnections
Reconnect gracefully
Consuming streaming data
Process Posts efficiently
Webhook delivery
Instead of maintaining a persistent connection, you can receive Posts via webhooks:Webhook delivery
Set up webhook delivery for filtered stream
Post edits
The stream delivers edited Posts with their edit history. Each edit creates a new Post ID:Edit Posts fundamentals
Learn more about Post edits
Getting started
Prerequisites
- An approved developer account
- A Project and App in the Developer Console
- Your App’s Bearer Token
Quickstart
Connect to the stream in minutes
Build a rule
Learn rule syntax
Operator reference
All available operators
Sample code
Working code examples
Advanced topics
Handling disconnections
Reconnect gracefully
High volume capacity
Handle high throughput
Recovery and redundancy
Build resilient applications
Matching returned Posts
Identify which rules matched