Skip to content

getUsers(__userFields_tweetFields_)

daneden edited this page Jan 13, 2022 · 2 revisions

getUsers(_:userFields:tweetFields:)

Returns a variety of information about one or more users specified by the requested IDs.

public func getUsers(_ userIds: [User.ID],
                       userFields: [User.Fields] = [],
                       tweetFields: [Tweet.Fields] = []
  )

Equivalent to GET /2/users.

Parameters

  • userIds: The list of user IDs. Up to 100 are allowed in a single request.
  • userFields: This fields parameter enables you to select which specific user fields will deliver with each returned user 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 struct.

Returns

A Twitter API response object containing an array of User structs and any pinned tweets in the includes property

Types
Global Variables
Global Functions
Extensions
Clone this wiki locally