usersShow method

Future<User> usersShow({
  1. String? userId,
  2. String? screenName,
  3. bool? includeEntities,
  4. String tweetMode = 'extended',
  5. TransformResponse<User> transform = defaultUserTransform,
})

Returns a variety of information about the user specified by the required userId or screenName parameter. The author's most recent Tweet will be returned inline when possible.

usersLookup is used to retrieve a bulk collection of user objects.

You must be following a protected user to be able to see their most recent Tweet. If you don't follow a protected user, the user's Tweet will be removed. A Tweet will not always be returned in the currentStatus field.

userId: The ID of the user for whom to return results. Either an id or screenName is required for this method.

screenName: The screen name of the user for whom to return results. Either an id or screenName is required for this method.

includeEntities: The entities node will not be included when set to false.

tweetMode: When set to extended, uses the extended Tweets. See https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/intro-to-tweet-json#extendedtweet.

transform: Can be used to parse the request. By default, the response is parsed in an isolate.

See https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-show.

Implementation

Future<User> usersShow({
  String? userId,
  String? screenName,
  bool? includeEntities,
  String tweetMode = 'extended',
  TransformResponse<User> transform = defaultUserTransform,
}) async {
  final params = <String, String>{}
    ..addParameter('user_id', userId)
    ..addParameter('screen_name', screenName)
    ..addParameter('include_entities', includeEntities)
    ..addParameter('tweet_mode', tweetMode);

  return client
      .get(Uri.https('api.twitter.com', '1.1/users/show.json', params))
      .then(transform);
}