getUserBy(username_userFields_tweetFields_) - daneden/Twift GitHub Wiki

getUserBy(username:userFields:tweetFields:)

Returns a variety of information about a single user specified by the requested username.

public func getUserBy(username: String,
                      userFields: [User.Fields] = [],
                      tweetFields: [Tweet.Fields] = []
  )

Equivalent to GET /2/users/by/username/:username.

Parameters

  • wrappedUserID: The ID or screen name of the user to lookup.
  • userFields: This fields parameter enables you to select which specific user fields will deliver with each returned users objects. These specified user fields will display directly in the returned user struct.
  • tweetFields: This fields parameter enables you to select which specific Tweet fields will deliver in each returned pinned Tweet. The Tweet fields will only return if the user has a pinned Tweet. While the referenced Tweet ID will be located in the original Tweet object, you will find this ID and all additional Tweet fields in the includes property on the returned TwitterAPIDataAndIncludes.

Returns

A Twitter API response object containing the User and any pinned tweets