Skip to main content
Access Stream endpoints via client.stream (StreamClient).

Methods

activity

GET /2/activity/stream Streaming Activity Stream Stream of X Activities

Parameters

Returns: Generator[ActivityResponse, None, None]

get_rule_counts

GET /2/tweets/search/stream/rules/counts Get Stream Rule Counts Retrieves the count of rules in the active rule set for the filtered stream.

Parameters

Returns: GetRuleCountsResponse

get_rules

GET /2/tweets/search/stream/rules Paginated Get Stream Rules Returns the active filtered-stream rules for the authenticated app. Provide ids to fetch specific rules; omit it to list all rules.

Parameters

Returns: Iterator[GetRulesResponse]

labels_compliance

GET /2/tweets/label/stream Streaming Stream Post Labels Streams all labeling events applied to Posts.

Parameters

Returns: Generator[LabelsComplianceResponse, None, None]

likes_compliance

GET /2/likes/compliance/stream Streaming Stream Likes Compliance Data Streams all compliance data related to Likes for Users.

Parameters

Returns: Generator[LikesComplianceResponse, None, None]

likes_firehose

GET /2/likes/firehose/stream Streaming Stream All Likes Streams all public Likes in real-time.

Parameters

int
required
The partition number.
Returns: Generator[LikesFirehoseResponse, None, None]

likes_sample10

GET /2/likes/sample10/stream Streaming Stream Sampled Likes Streams a 10% sample of public Likes in real-time.

Parameters

int
required
The partition number.
Returns: Generator[LikesSample10Response, None, None]

posts

GET /2/tweets/search/stream Streaming Stream Filtered Posts Streams Posts in real-time matching the active rule set.

Parameters

Returns: Generator[PostsResponse, None, None]

posts_compliance

GET /2/tweets/compliance/stream Streaming Stream Posts Compliance Data Streams all compliance data related to Posts.

Parameters

int
required
The partition number.
Returns: Generator[PostsComplianceResponse, None, None]

posts_firehose

GET /2/tweets/firehose/stream Streaming Stream All Posts Streams all public Posts in real-time.

Parameters

int
required
The partition number.
Returns: Generator[PostsFirehoseResponse, None, None]

posts_firehose_en

GET /2/tweets/firehose/stream/lang/en Streaming Stream English Posts Streams all public English-language Posts in real-time.

Parameters

int
required
The partition number.
Returns: Generator[PostsFirehoseEnResponse, None, None]

posts_firehose_ja

GET /2/tweets/firehose/stream/lang/ja Streaming Stream Japanese Posts Streams all public Japanese-language Posts in real-time.

Parameters

int
required
The partition number.
Returns: Generator[PostsFirehoseJaResponse, None, None]

posts_firehose_ko

GET /2/tweets/firehose/stream/lang/ko Streaming Stream Korean Posts Streams all public Korean-language Posts in real-time.

Parameters

int
required
The partition number.
Returns: Generator[PostsFirehoseKoResponse, None, None]

posts_firehose_pt

GET /2/tweets/firehose/stream/lang/pt Streaming Stream Portuguese Posts Streams all public Portuguese-language Posts in real-time.

Parameters

int
required
The partition number.
Returns: Generator[PostsFirehosePtResponse, None, None]

posts_sample

GET /2/tweets/sample/stream Streaming Stream Sampled Posts Streams a 1% sample of public Posts in real-time.

Parameters

Returns: Generator[PostsSampleResponse, None, None]

posts_sample10

GET /2/tweets/sample10/stream Streaming Stream 10% Sampled Posts Streams a 10% sample of public Posts in real-time.

Parameters

int
required
The partition number.
Returns: Generator[PostsSample10Response, None, None]

update_rules

POST /2/tweets/search/stream/rules Update Stream Rules Adds or deletes rules from the active rule set for the filtered stream. Exactly one of add, delete, or ?delete_all=true must be specified. Use ?dry_run=true to validate without committing.

Parameters

UpdateRulesRequest
required
Request payload.
Returns: UpdateRulesResponse

users_compliance

GET /2/users/compliance/stream Streaming Stream Users Compliance Data Streams all compliance data related to Users.

Parameters

int
required
The partition number.
Returns: Generator[UsersComplianceResponse, None, None]