lookupByName abstract method

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

Returns a variety of information about one or more users specified by their usernames.


  • username: The Twitter username (handle) of the user.

  • 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



Future<TwitterResponse<UserData, void>> lookupByName({
  required String username,
  List<UserExpansion>? expansions,
  List<TweetField>? tweetFields,
  List<UserField>? userFields,