You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: changelog.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -518,11 +518,11 @@ On August 12th, 2020, we launched the new X API v2: Early access. With this rele
518
518
519
519
Today marks 60 days since the launch, meaning that we have retired the following endpoints. If you are using the Labs versions of these endpoints, you can use the linked migration guides to update your integration to start using the new X API v2 versions:
Copy file name to clipboardExpand all lines: x-api/posts/counts/integrate/build-a-query.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ Characters with accents or diacritics are treated the same as normal characters
93
93
94
94
All operators are evaluated in a case-insensitive manner. For example, the query cat will match Posts with all of the following: _cat_, _CAT_, _Cat_.
95
95
96
-
The [filtered stream](/x-api/posts/filtered-stream) matching behavior acts differently from Post counts. When [building a filtered stream rule](/x-api/posts/filtered-stream#building-rules-for-filtered-stream), know that keywords and hashtags that include accents and diacritics will only match on terms that also include the accent and diacritic, and will not match on terms that use normal characters instead.
96
+
The [filtered stream](/x-api/posts/filtered-stream) matching behavior acts differently from Post counts. When [building a filtered stream rule](/x-api/posts/filtered-stream/integrate/build-a-rule), know that keywords and hashtags that include accents and diacritics will only match on terms that also include the accent and diacritic, and will not match on terms that use normal characters instead.
97
97
98
98
For example, filtered stream rules that include a keyword Diacrítica or hashtag #cumpleaños will only match the terms _Diacrítica_ and _#cumpleaños_, and will not match on _Diacritica_ or _#cumpleanos_ without the tilde í or eñe
The filtered stream endpoints deliver Posts that match a set of rules applied to the stream. Rules are made up of operators that match on a variety of Post attributes.
9
9
10
-
Multiple rules can be applied using the [POST /tweets/search/stream/rules](/x-api/posts/filtered-stream#post-2-tweets-search-stream-rules) endpoint. Once you've added rules and connected using [GET /tweets/search/stream](/x-api/posts/filtered-stream#get-2-tweets-search-stream), only Posts matching your rules will be delivered. You do not need to disconnect to add or remove rules.
10
+
Multiple rules can be applied using the [POST /tweets/search/stream/rules](/x-api/stream/update-stream-rules) endpoint. Once you've added rules and connected using [GET /tweets/search/stream](/x-api/stream/get-stream-rules), only Posts matching your rules will be delivered. You do not need to disconnect to add or remove rules.
11
11
12
12
---
13
13
@@ -188,7 +188,7 @@ Holiday Posts are appearing. Exclude them:
188
188
189
189
## Adding and removing rules
190
190
191
-
Use [POST /2/tweets/search/stream/rules](/x-api/posts/filtered-stream#post-2-tweets-search-stream-rules) to add or remove rules.
191
+
Use [POST /2/tweets/search/stream/rules](/x-api/stream/update-stream-rules) to add or remove rules.
Copy file name to clipboardExpand all lines: x-api/posts/filtered-stream/integrate/matching-returned-tweets.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The filtered stream endpoint gives you the ability to have multiple rules in pla
10
10
11
11
When you specify your rules to match Posts based on a wide variety of attributes, including user attributes, geo-location, language, and many others, you can attach a tag to distinguish this rule at a higher level. Tags are a good way to contextualize your rule, especially if you have many rules in place. The filtering rules determine which Post activities will be sent through the connection.
12
12
13
-
If you need to add a new filtering rule to capture a different type of Post, or remove an existing rule, your app can send a request to the [POST tweets/search/stream/rules](/x-api/posts/filtered-stream#post-2-tweets-search-stream-rules) endpoint to make it happen. When that request is sent, the filtering rules are automatically modified and the changes simply take effect in the data stream with no need to reconnect. Most rule additions take effect about 20 seconds or less. It’s unlikely, but depending on external factors (for example, network connectivity), it may take longer before you start receiving matching Posts. If you can’t find a rule in the list rule endpoint, make sure that the rule creation request succeeded; this can be done by checking your logs for any error messages.
13
+
If you need to add a new filtering rule to capture a different type of Post, or remove an existing rule, your app can send a request to the [POST tweets/search/stream/rules](/x-api/stream/update-stream-rules) endpoint to make it happen. When that request is sent, the filtering rules are automatically modified and the changes simply take effect in the data stream with no need to reconnect. Most rule additions take effect about 20 seconds or less. It’s unlikely, but depending on external factors (for example, network connectivity), it may take longer before you start receiving matching Posts. If you can’t find a rule in the list rule endpoint, make sure that the rule creation request succeeded; this can be done by checking your logs for any error messages.
| HTTP methods supported | POST | GET <br/>POST | GET <br/>POST |
28
-
| Required parameters | Rule defined on connection as parameter, at least one of:<br/><br/>*******follow******<br/>*******track******<br/>*******locations******| No required parameters for streaming connection, optional backfill parameter.<br/><br/>Rules managed separately | No required parameters for streaming connection, optional parameters to define response format and add [backfill recovery feature](/x-api/posts/filtered-stream#recovering-missed-data-after-a-disconnection-backfill) for Academic Research access.<br/><br/>Rules managed separately |
28
+
| Required parameters | Rule defined on connection as parameter, at least one of:<br/><br/>*******follow******<br/>*******track******<br/>*******locations******| No required parameters for streaming connection, optional backfill parameter.<br/><br/>Rules managed separately | No required parameters for streaming connection, optional parameters to define response format and add [backfill recovery feature](/x-api/fundamentals/recovery-and-redundancy) for Academic Research access.<br/><br/>Rules managed separately |
| Default request rate limits | 5 connection attempts per 5 min | 60 requests per min aggregated for both POST and GET requests<br/><br/>/rules: 60 requests per minute, aggregated across all requests to /rules endpoint for the specific stream's API (POST and GET). | Depends on the endpoint. See [rate limits](/x-api/fundamentals/rate-limits) for current limits. |
31
31
| Maximum allowed connections | 2 concurrent per authorized user | Supports multiple/redundant connections, determined by contract | Pay-per-use: 1 |
32
-
|[Recovery and redundancy features](/x-api/posts/filtered-stream#filtered-stream-recovery-and-redundancy-features)| None | Backfill, redundant connections, and the Replay API ||
32
+
|[Recovery and redundancy features](/x-api/fundamentals/recovery-and-redundancy)| None | Backfill, redundant connections, and the Replay API ||
33
33
| Keep-alive signal/heartbeats | blank lines (\\r\\n or similar) at least every 20 seconds | blank lines (\\r\\n or similar) every 10 seconds | blank lines (\\r\\n or similar) at least every 20 seconds |
34
34
| Latency | 10 seconds | 2 seconds<br/><br/>At least 10 seconds for URL unwinding enrichment | 10 seconds |
35
35
| Maximum allowed rules | 1 rule (within the endpoint connection request) | Determined by contract up to 250,000 | Pay-per-use: 1,000 rules |
36
36
| Rule filter limitations | One query per connection, up to either:<br/><br/>\- 400 track keywords<br/><br/>\- 5000 follow user IDs<br/><br/>\- 25 location boxes | Up to 2,048 characters per rule | Pay-per-use: 1,024 characters per rule |
37
37
|[Post JSON format](/x-api/fundamentals/data-dictionary)| Standard v1.1 format |[Native Enriched](/x-api/enterprise-gnip-2.0/fundamentals/data-dictionary#native-enriched-tweet-object) or [Activity Streams]() (selected within the [console](/x-api/enterprise-gnip-2.0/fundamentals/overview)) |[X API v2 format](/x-api/fundamentals/data-dictionary) (determined by ******fields****** and ******expansions****** request parameters, not backward-compatible with v1.1 formats)<br/><br/>To learn more about how to migrate from the Standard v1.1 format to the X API v2 format, please visit our [data formats migration guide](/x-api/migrate/data-format-migration). We will be releasing additional data format migration guides for Native Enriched and Activity Streams soon. |
38
38
| Provides Post edit history and metadata | ✔ | ✔ | ✔ |
39
-
| Unique Features | Filtering done via query parameters on connection request<br/><br/>No configuration UI | Filtering done via rules created through an independent endpoint<br/><br/>[Enrichment](/x-api/enterprise-gnip-2.0/enterprise-gnip#enrichments) features available in contract<br/><br/>Configuration on console.gnip.com UI | Filtering done via [rules](/x-api/posts/filtered-stream/integrate/build-a-rule) created through an independent endpoint<br/><br/>[Metrics](/x-api/fundamentals/metrics) and URL enrichment features included<br/><br/>Object [fields](/x-api/fundamentals/fields) and [expansions](/x-api/fundamentals/expansions) specified with request parameters<br/><br/>Post [Annotations](/x-api/fundamentals/post-annotations)<br/><br/>[Conversation ID](/x-api/fundamentals/conversation-id) operator and field<br/><br/>Configuration through [Developer Console](/resources/fundamentals/developer-portal)|
40
-
41
-
**Other migration resources**
42
-
43
-
[Standard v1.1 migration to X API v2](/x-api/posts/filtered-stream#standard-v1-1-compared-to-x-api-v2"Standard v1.1 migration to X API v2")
44
-
45
-
[PowerTrack API migration to X API v2](/x-api/enterprise-gnip-2.0/powertrack-api#powertrack-operators"PowerTrack API migration to X API v2")
46
-
47
-
[X API migration hub](/x-api/migrate/overview)
48
-
49
-
[Check out some sample code for these endpoints](https://github.com/xdevplatform/Twitter-API-v2-sample-code"Check out some sample code for these endpoints")
39
+
| Unique Features | Filtering done via query parameters on connection request<br/><br/>No configuration UI | Filtering done via rules created through an independent endpoint<br/><br/>[Enrichment](/x-api/enterprise-gnip-2.0/enterprise-gnip#enrichments) features available in contract<br/><br/>Configuration on console.gnip.com UI | Filtering done via [rules](/x-api/posts/filtered-stream/integrate/build-a-rule) created through an independent endpoint<br/><br/>[Metrics](/x-api/fundamentals/metrics) and URL enrichment features included<br/><br/>Object [fields](/x-api/fundamentals/fields) and [expansions](/x-api/fundamentals/expansions) specified with request parameters<br/><br/>Post [Annotations](/x-api/fundamentals/post-annotations)<br/><br/>[Conversation ID](/x-api/fundamentals/conversation-id) operator and field<br/><br/>Configuration through [Developer Console](/resources/fundamentals/developer-portal)|
|**Connection endpoint**| GET /stream |[GET /2/tweets/search/stream](/x-api/stream/stream-filtered-posts)|
53
+
|**Add rules**| POST /rules |[POST /2/tweets/search/stream/rules](/x-api/stream/update-stream-rules)|
54
+
|**Get rules**| GET /rules |[GET /2/tweets/search/stream/rules](/x-api/stream/get-stream-rules)|
55
+
|**Delete rules**| POST /rules_method=delete |[POST /2/tweets/search/stream/rules](/x-api/stream/update-stream-rules)|
56
56
57
57
**Rule syntax, operators, and matching rules logic**
58
58
59
-
The X API v2 filtered stream uses a subset of the same rule operators currently used for PowerTrack rules. These operators are used to create boolean based rule syntax used for filtering desired matching Posts from the live stream. Both PowerTrack and filtered stream use the same rule syntax for building rules and matching logic is the same. While the majority of the operators are available for both PowerTrack and filter stream, there are a few notable differences and net new operators listed below. For more details and example uses for each operator see current [PowerTrack operators](/x-api/enterprise-gnip-2.0/powertrack-api#powertrack-operators) and current X API v2 [filtered stream operators](/x-api/posts/filtered-stream#building-rules-for-filtered-stream).
59
+
The X API v2 filtered stream uses a subset of the same rule operators currently used for PowerTrack rules. These operators are used to create boolean based rule syntax used for filtering desired matching Posts from the live stream. Both PowerTrack and filtered stream use the same rule syntax for building rules and matching logic is the same. While the majority of the operators are available for both PowerTrack and filter stream, there are a few notable differences and net new operators listed below. For more details and example uses for each operator see current [PowerTrack operators](/x-api/enterprise-gnip-2.0/powertrack-api#powertrack-operators) and current X API v2 [filtered stream operators](/x-api/posts/filtered-stream/integrate/operators).
60
60
61
61
Please note that many operators (noted as 'advanced operators') are reserved for those users who have been approved for [Academic Research access or Enterprise access](/x-api/getting-started/about-x-api).
62
62
@@ -78,7 +78,7 @@ Operators available with both PowerTrack and X API v2 Filtered stream:
78
78
79
79
**Support for Post edit history and metadata**
80
80
81
-
Both versions provide metadata that describes any edit history. Check out the [filtered stream API References](/x-api/posts/filtered-stream#api-reference-index) and the [Edit Posts fundamentals page](/x-api/fundamentals/edit-posts) for more details.
81
+
Both versions provide metadata that describes any edit history. Check out the [filtered stream API References](/x-api/posts/filtered-stream/introduction) and the [Edit Posts fundamentals page](/x-api/fundamentals/edit-posts) for more details.
Copy file name to clipboardExpand all lines: x-api/posts/filtered-stream/migrate/standard-to-twitter-api-v2.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ If you have been working with the v1.1 [statuses/filter](https://developer.x.co
25
25
26
26
**Request parameters and operators**
27
27
28
-
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](/x-api/posts/filtered-stream#building-rules-for-filtered-stream) 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.
28
+
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](/x-api/posts/filtered-stream/integrate/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.
29
29
30
30
The following standard v1.1 request parameters have equivalent operators in X API v2:
31
31
@@ -37,7 +37,7 @@ The following standard v1.1 request parameters have equivalent operators in X AP
37
37
38
38
**Support for Post edit history and metadata**
39
39
40
-
Both versions provide metadata that describes any edit history. Check out the [filtered stream API References](/x-api/posts/filtered-stream#api-reference-index) and the [Post edits fundamentals page](/x-api/fundamentals/edit-posts) for more details.
40
+
Both versions provide metadata that describes any edit history. Check out the [filtered stream API References](/x-api/posts/filtered-stream/introduction) and the [Post edits fundamentals page](/x-api/fundamentals/edit-posts) for more details.
41
41
42
42
#### Differences
43
43
@@ -111,7 +111,7 @@ Redundant connections allows you to connect to a given stream up to two times, w
111
111
112
112
The backfill_minutes parameter can be used to recover up to five minutes of missed data.
113
113
114
-
Both of these features are only available via [Academic Research access](/x-api/getting-started/about-x-api). You can learn more about this functionality via our [recovery and redundancy features](/x-api/posts/filtered-stream#filtered-stream-recovery-and-redundancy-features) integration guide.
114
+
Both of these features are only available via [Academic Research access](/x-api/getting-started/about-x-api). You can learn more about this functionality via our [recovery and redundancy features](/x-api/fundamentals/recovery-and-redundancy) integration guide.
Copy file name to clipboardExpand all lines: x-api/posts/timelines/migrate/standard-to-twitter-api-v2.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ The v1.1 statuses/mentions_timeline and the X API v2 user mention timeline endpo
50
50
51
51
**Support for Post edit history and metadata**
52
52
53
-
Both versions provide metadata that describes any edit history. Check out the [filtered stream API References](/x-api/posts/filtered-stream#api-reference-index) and the [Edit Posts fundamentals page](/x-api/fundamentals/edit-posts) for more details.
53
+
Both versions provide metadata that describes any edit history. Check out the [filtered stream API References](/x-api/posts/filtered-stream/introduction) and the [Edit Posts fundamentals page](/x-api/fundamentals/edit-posts) for more details.
0 commit comments