Standard v1.1 compared to X API v2
If you have been working with the v1.1 statuses/filter endpoint, this guide can help you understand the similarities and differences between the standard and X API v2 filtered stream endpoints.- Similarities
- Request parameters and operators
- Support for Post edit history and metadata
- Differences
- Endpoint URLs
- App and Project requirement
- Authentication method
- Rule volume and persistent stream
- Response data format
- Request parameters
- Availability of recovery and redundancy features
- Query operators
Similarities
Request parameters and operators The standard v1.1 statuses/filter endpoint features a few parameters that can be passed along with the request to filter the stream. With v2 filtered stream, you instead use a set of operators that can be connected together using boolean logic to filter for desired Posts. The available operators include some that are direct replacements for the existing standard v1.1 parameters. The following standard v1.1 request parameters have equivalent operators in X API v2:| Standard | X API v2 |
|---|---|
| follow - A comma-separated list of user IDs, indicating the users whose Posts should be delivered on the stream. | Many operators that can help you find Posts related to specific users: * @ * from: * to: * etc. |
| track - A comma-separated list of phrases which will be used to determine what Posts will be delivered on the stream. | Many operators that can help you find Posts related to specific keywords: * keyword * “exact phrase match” * # * etc. |
Differences
Endpoint URLs- Standard v1.1 endpoints:
- X API v2 endpoint:
- At the JSON root level, the standard endpoints return Post objects in a statuses array, while X API v2 returns a data array.
- Instead of referring to Retweeted and Quoted “statuses”, X API v2 JSON refers to Retweeted and Quoted Tweets. Many legacy and deprecated fields, such as contributors and user.translator_type are being removed.
- Instead of using both favorites (in Post object) and favourites (in user object), X API v2 uses the term like.
- X is adopting the convention that JSON values with no value (for example, null) are not written to the payload. Post and user attributes are only included if they have a non-null values.
- A conversation_id field
- Two new annotations fields, including context and entities
- Several new metrics fields
- A new reply_setting field, which shows you who can reply to a given Post
| Standard v1.1 parameter | Details |
|---|---|
| locations - A comma-separated list of longitude,latitude pairs specifying a set of bounding boxes to filter Posts by. | We have not released location-based operators for X API v2 yet. |
| Delimited | With the v1.1 endpoint, setting this to the string length indicates that statuses should be delimited in the stream, so that clients know how many bytes to read before the end of the status message. This functionality is not available with X API v2. |
| Stall_warnings | With the v1.1 endpoint, setting this parameter to true will cause periodic messages to be delivered if the client is in danger of being disconnected. With X API v2, stall warnings are sent by default with the new line sent every so often. |
- Conversation IDs - As conversations unfold on X, a conservation ID will be available to mark Posts that are part of the conversation. All Posts in the conversation will have their conversation_id set to the Post ID that started it.
- conversation_id:
- X Annotations provide contextual information about Posts, and include entity and context annotations. Entities are comprised of people, places, products and organizations. Contexts are domains, or topics, that surfaced entities are a part of. For example, people mentioned in a Post may have a context that indicates whether they are an athlete, actor, or politician.
- context: - matches on Posts that have been annotated with a context of interest.
- entity: - matches on Posts that have been annotated with an entity of interest.