userTimeline(__startTime_endTime_exclude_sinceId_untilId_fields_expansions_paginationToken_maxResults_) - daneden/Twift GitHub Wiki

userTimeline(_:startTime:endTime:exclude:sinceId:untilId:fields:expansions:paginationToken:maxResults:)

Returns Tweets composed by a single user, specified by the requested user ID. By default, the most recent ten Tweets are returned per request. Using pagination, the most recent 3,200 Tweets can be retrieved.

public func userTimeline(_ userId: User.ID,
                           startTime: Date? = nil,
                           endTime: Date? = nil,
                           exclude: [TweetExclusion]? = nil,
                           sinceId: Tweet.ID? = nil,
                           untilId: Tweet.ID? = nil,
                           fields: Set<Tweet.Field> = [],
                           expansions: [Tweet.Expansions] = [],
                           paginationToken: String? = nil,
                           maxResults: Int = 10
  )

Equivalent to GET /2/users/:id/timeline

Parameters

  • userId: Unique identifier of the Twitter account (user ID) for whom to return results.
  • startTime: The oldest or earliest UTC timestamp from which the Tweets will be provided. Only the 3200 most recent Tweets are available. Timestamp is in second granularity and is inclusive (for example, 12:00:01 includes the first second of the minute). Minimum allowable time is 2010-11-06T00:00:00Z
  • endTime: The newest or most recent UTC timestamp from which the Tweets will be provided. Only the 3200 most recent Tweets are available. Timestamp is in second granularity and is inclusive (for example, 12:00:01 includes the first second of the minute). Minimum allowable time is 2010-11-06T00:00:01Z
  • exclude: Comma-separated list of the types of Tweets to exclude from the response. When exclude=retweets is used, the maximum historical Tweets returned is still 3200. When the exclude=replies parameter is used for any value, only the most recent 800 Tweets are available.
  • sinceId: Returns results with a Tweet ID greater than (that is, more recent than) the specified 'since' Tweet ID. Only the 3200 most recent Tweets are available. The result will exclude the since_id. If the limit of Tweets has occurred since the since_id, the since_id will be forced to the oldest ID available.
  • untilId: Returns results with a Tweet ID less less than (that is, older than) the specified 'until' Tweet ID. Only the 3200 most recent Tweets are available. The result will exclude the until_id. If the limit of Tweets has occurred since the until_id, the until_id will be forced to the most recent ID available.
  • fields: Any additional fields to include on returned objects
  • expansions: Objects and their corresponding fields that should be expanded in the includes property
  • paginationToken: This parameter is used to move forwards or backwards through 'pages' of results, based on the value of the next_token or previous_token in the response. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
  • maxResults: Specifies the number of Tweets to try and retrieve, up to a maximum of 100 per distinct request. By default, 10 results are returned if this parameter is not supplied. The minimum permitted value is 5. It is possible to receive less than the max_results per request throughout the pagination process.

Returns

A response object containing the requested Tweets and additional data objects.