lookupById abstract method

Future<TwitterResponse<UserData, void>> lookupById({
  1. required String userId,
  2. List<UserExpansion>? expansions,
  3. List<TweetField>? tweetFields,
  4. List<UserField>? userFields,
})

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

Parameters

  • userId: The ID of the user to lookup.

  • expansions: Expansions enable you to request additional data objects that relate to the originally returned users. The ID that represents the expanded data object will be included directly in the user 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 pinned Tweet. The Tweet fields will only return if the user has a pinned Tweet and if you've also included the expansions=pinned_tweet_id query parameter in your request. 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 data object.

  • 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 user data objects.

Endpoint Url

Authentication Methods

  • OAuth 2.0 Authorization Code with PKCE
  • OAuth 2.0 App-only
  • OAuth 1.0a

Required Scopes

  • tweet.read
  • users.read

Rate Limits

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

  • User rate limit (OAuth 2.0 user Access Token): 900 requests per 15-minute window per each authenticated user

Reference

Implementation

Future<TwitterResponse<UserData, void>> lookupById({
  required String userId,
  List<UserExpansion>? expansions,
  List<TweetField>? tweetFields,
  List<UserField>? userFields,
});