The filtered stream endpoint group enables developers to filter the real-time stream of public Posts. This endpoint group’s functionality includes multiple endpoints that enable you to create and manage rules, and apply those rules to filter a stream of real-time Posts that will return matching public Posts. This endpoint group allows users to listen for specific topics and events in real-time, monitor the conversation around competitions, understand how trends develop in real-time, and much more.

Developers can use the REST rules endpoint to add and remove rules to a persistent stream connection without needing to disconnect. These rules can be created with operators that match on Post attributes such as message keywords, hashtags, and URLs. Operators and rule clauses can be combined with boolean logic and parentheses to help refine the filter’s matching behavior. 

Once you've added a set of rules, you can establish a streaming connection which will start to deliver Post objects in JSON format through a persistent HTTP Streaming connection. You will only receive content matching your rules while connected to the stream.

The filtered search endpoint supports edited Posts. This endpoint will deliver edited Posts that match one or more of your filters, along with its edit history, including an array of Post IDs. For Posts with no edit history, this array will hold a single ID. For Posts that have been edited, this array contains multiple IDs, arranged in ascending order reflecting the order of edits, with the most recent version in the last position of the array. To learn more about how Post edits work, see the Posts edits fundamentals page. 

Certain aspects of the filtered stream endpoint are limited by access level:

Pro access

  • 1000 rules per stream
  • 100 requests per 15 minutes when using the POST /2/tweets/search/stream/rules endpoint to add rules
  • Can use all operators when building your rule
  • Can build rules up to 1024 characters in length


The returned Posts from filtered stream count towards the monthly Post cap.

Account setup

To access these endpoints, you will need:

Learn more about getting access to the X API v2 endpoints in our getting started guide.