connectSample10Stream abstract method

Future<TwitterStreamResponse<TwitterResponse<TweetData, void>>> connectSample10Stream({
  1. required DecahosePartition partition,
  2. int? backfillMinutes,
  3. List<TweetExpansion>? expansions,
  4. List<TweetField>? tweetFields,
  5. List<UserField>? userFields,
  6. List<PlaceField>? placeFields,
  7. List<PollField>? pollFields,
  8. List<MediaField>? mediaFields,
})

Makes 1 of 2 connections to the 10% sample stream of all Tweets in real-time.

Available to Enterprise levels of access. Commonly referred to as the "Decahose".

If you have Academic Research access, you can connect up to two redundant connections to maximize your streaming up-time.

Parameters

  • partition: The 10% sampled stream is split into 2 partitions, each requiring their own connection request. Use this parameter to specify which partition you are connecting to.

  • backfillMinutes: By passing this parameter, you can request up to five (5) minutes worth of streaming data that you might have missed during a disconnection to be delivered to you upon reconnection. The backfilled Tweets will automatically flow through the reconnected stream, with older Tweets generally being delivered before any newly matching Tweets. You must include a whole number between 1 and 5 as the value to this parameter.

                   This feature will deliver duplicate Tweets, meaning
                   that if you were disconnected for 90 seconds, and you
                   requested two minutes of backfill, you will receive
                   30 seconds worth of duplicate Tweets. Due to this,
                   you should make sure your system is tolerant of
                   duplicate data.
    
                   This feature is currently only available to those
                   that have been approved for Academic Research access.
                   To learn more about this access level, please visit
                   our section on [Academic Research](https://developer.twitter.com/en/products/twitter-api/academic-research).
    
  • expansions: Expansions enable you to request additional data objects that relate to the originally returned Tweets. Submit a list of desired expansions in a comma-separated list without spaces. The ID that represents the expanded data object will be included directly in the Tweet data object, but the expanded object metadata will be returned within the includes response object, and will also include the ID so that you can match this data object to the original Tweet object.

  • tweetFields: This fields parameter enables you to select which specific Tweet fields will deliver in each returned Tweet object. You can also pass expansions to return the specified fields for both the original Tweet and any included referenced Tweets. The requested Tweet fields will display in both the original Tweet data object, as well as in the referenced Tweet expanded data object that will be located in the includes data object.

  • userFields: This fields parameter enables you to select which specific user fields will deliver in each returned Tweet. While the user ID will be located in the original Tweet object, you will find this ID and all additional user fields in the includes data object.

  • placeFields: This fields parameter enables you to select which specific place fields will deliver in each returned Tweet. Specify the desired fields in a comma-separated list without spaces between commas and fields. The Tweet will only return place fields if the Tweet contains a place and if you’ve also included the expansions=geo.place_id query parameter in your request. While the place ID will be located in the Tweet object, you will find this ID and all additional place fields in the includes data object.

  • pollFields: This fields parameter enables you to select which specific poll fields will deliver in each returned Tweet. Specify the desired fields in a comma-separated list without spaces between commas and fields. The Tweet will only return poll fields if the Tweet contains a poll and if you've also included the expansions=attachments.poll_ids query parameter in your request. While the poll ID will be located in the Tweet object, you will find this ID and all additional poll fields in the includes data object.

  • mediaFields: This fields parameter enables you to select which specific media fields will deliver in each returned Tweet. Specify the desired fields in a comma-separated list without spaces between commas and fields. The Tweet will only return media fields if the Tweet contains media and if you've also included the expansions=attachments.media_keys query parameter in your request. While the media ID will be located in the Tweet object, you will find this ID and all additional media fields in the includes data object.

Endpoint Url

Authentication Methods

  • OAuth 2.0 App-only

Rate Limits

  • App rate limit (OAuth 2.0 App Access Token): 50 requests per 15-minute window shared among all users of your app

Reference

Implementation

Future<TwitterStreamResponse<TwitterResponse<TweetData, void>>>
    connectSample10Stream({
  required DecahosePartition partition,
  int? backfillMinutes,
  List<TweetExpansion>? expansions,
  List<TweetField>? tweetFields,
  List<UserField>? userFields,
  List<PlaceField>? placeFields,
  List<PollField>? pollFields,
  List<MediaField>? mediaFields,
});