Overview

The filtered stream endpoint group enables developers to filter a 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 Posts that will return matching public Posts. This endpoint group allows users to listen for specific topics and events, monitor the conversation around competitions, understand how trends develop, and much more. Developers can use the REST rules endpoint to add and remove rules to filter for Posts matching a defined criteria. 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 register your webhook where X will start to deliver Post objects in JSON format. You will only receive content matching your rules to your webhook. This endpoint supports edited Posts. Your webhook will receive 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.  Note: This endpoint group is similar to the v2 filtered stream endpoint for setting up your rules. The only difference is the delivery mechanisms for the Posts that match your rules.
  • In case of v2 filtered stream endpoint, you have to establish a persistent connection and listen for Posts matching your rules.
  • In case of this filtered stream webhook endpoint, you register your webhook, and X delivers Posts matching your rules to your webhook.
This eliminates the need for handling disconnects stemming from client drops or server-side drops from normal restarts to our service. Since we will likely be delivering hundreds of events/second, it is necessary for your webhook server to be able to handle these simultaneous connection attempts. This endpoint is currently available to Enterprise developers and supports the following configuration:
  • 25,000+ rules per project
  • Can use all operators when building your rule
  • Can build rules up to 2048 characters in length
  • Apply here for Enterprise access
The returned Posts from filtered stream count towards the monthly Post cap.
Account setupTo access these endpoints, you will need:Learn more about getting access to the X API v2 endpoints in our getting started guide.