View Source Tw.V1_1.User (Tw v0.1.0)

User data structure and related functions. https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/user

Link to this section Summary

Types

Parameters for block/2.

Parameters for blocked/2.

Parameters for follow/2.

Parameters for friends/2.

Parameters for get/2.

Parameters for get/2.

Parameters for list/2.

Parameters for mute/2.

Parameters for muted/2.

Parameters for search/2.

t()
fielddescription
idThe integer representation of the unique identifier for this User. This number is greater than 53 bits and some programming languages may have difficulty/silent defects in interpreting it. Using a signed 64 bit integer for storing this identifier is safe. Use id_str to fetch the identifier to be safe. See Twitter IDs for more information. Example: 6253282.
id_strThe string representation of the unique identifier for this User. Implementations should use this rather than the large, possibly un-consumable integer in id. Example: "6253282".
nameThe name of the user, as they’ve defined it. Not necessarily a person’s name. Typically capped at 50 characters, but subject to change. Example: "Twitter API".
screen_nameThe screen name, handle, or alias that this user identifies themselves with. screen_names are unique but subject to change. Use id_str as a user identifier whenever possible. Typically a maximum of 15 characters long, but some historical accounts may exist with longer names. Example: "twitterapi".
locationNullable . The user-defined location for this account’s profile. Not necessarily a location, nor machine-parseable. This field will occasionally be fuzzily interpreted by the Search service. Example: "San Francisco, CA".
derivedEnterprise APIs only Collection of Enrichment metadata derived for user. Provides the Profile Geo Enrichment metadata. See referenced documentation for more information, including JSON data dictionaries. Example: {"locations": [{"country":"United States","country_code":"US","locality":"Denver"}]}.
urlNullable . A URL provided by the user in association with their profile. Example: "https://developer.twitter.com".
descriptionNullable . The user-defined UTF-8 string describing their account. Example: "The Real Twitter API.".
protectedWhen true, indicates that this user has chosen to protect their Tweets. See About Public and Protected Tweets . Example: true.
verifiedWhen true, indicates that the user has a verified account. See Verified Accounts . Example: false.
followers_countThe number of followers this account currently has. Under certain conditions of duress, this field will temporarily indicate “0”. Example: 21.
friends_countThe number of users this account is following (AKA their “followings”). Under certain conditions of duress, this field will temporarily indicate “0”. Example: 32.
listed_countThe number of public lists that this user is a member of. Example: 9274.
favourites_countThe number of Tweets this user has liked in the account’s lifetime. British spelling used in the field name for historical reasons. Example: 13.
statuses_countThe number of Tweets (including retweets) issued by the user. Example: 42.
created_atThe UTC datetime that the user account was created on Twitter. Example: "Mon Nov 29 21:18:15 +0000 2010".
profile_banner_urlThe HTTPS-based URL pointing to the standard web representation of the user’s uploaded profile banner. By adding a final path element of the URL, it is possible to obtain different image sizes optimized for specific displays. For size variants, please see User Profile Images and Banners .Example: "https://si0.twimg.com/profile_banners/819797/1348102824".
profile_image_url_httpsA HTTPS-based URL pointing to the user’s profile image. Example: "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png".
default_profileWhen true, indicates that the user has not altered the theme or background of their user profile. Example: false.
default_profile_imageWhen true, indicates that the user has not uploaded their own profile image and a default image is used instead. Example: false.
withheld_in_countriesWhen present, indicates a list of uppercase two-letter country codes this content is withheld from. Twitter supports the following non-country values for this field:“XX” - Content is withheld in all countries “XY” - Content is withheld due to a DMCA request.Example: ["GR", "HK", "MY"].
withheld_scopeWhen present, indicates that the content being withheld is a “user.”Example: "user".
entities-

Parameters for unblock/2.

Parameters for unfollow/2.

Parameters for unmute/2.

Functions

Request POST /blocks/create.json and return decoded result.

Request GET /blocks/list.json and return decoded result.

Request GET /blocks/ids.json and return decoded result.

Decode JSON-decoded map into t/0

Request POST /friendships/create.json and return decoded result.

Request GET /followers/ids.json and return decoded result.

Request GET /followers/list.json and return decoded result.

Request GET /friends/ids.json and return decoded result.

Request GET /friends/list.json and return decoded result.

Request GET /users/show.json and return decoded result.

Request GET /friendships/show.json and return decoded result.

Request GET /users/profile_banner.json and return decoded result.

Request GET /users/lookup.json and return decoded result.

Request GET /friendships/lookup.json and return decoded result.

Check if the specified user is a member of the specified list.

Request GET /lists/members.json and return decoded result.

Check if the specified user is a subscriber of the specified list. Returns the user if they are a subscriber.

Request GET /lists/subscribers.json and return decoded result.

Request POST /mutes/users/create.json and return decoded result.

Request GET /mutes/users/list.json and return decoded result.

Request GET /mutes/users/ids.json and return decoded result.

Request GET /friendships/no_retweets/ids.json and return decoded result.

Request GET /friendships/incoming.json and return decoded result.

Request GET /friendships/outgoing.json and return decoded result.

Request POST /users/report_spam.json and return decoded result.

Request GET /statuses/retweeters/ids.json and return decoded result.

Request GET /users/search.json and return decoded result.

Request POST /blocks/destroy.json and return decoded result.

Request POST /friendships/destroy.json and return decoded result.

Request POST /mutes/users/destroy.json and return decoded result.

Request POST /friendships/update.json and return decoded result.

Link to this section Types

Specs

block_params() ::
  %{
    :screen_name => screen_name(),
    optional(:include_entities) => boolean(),
    optional(:skip_status) => boolean()
  }
  | %{
      :user_id => id(),
      optional(:include_entities) => boolean(),
      optional(:skip_status) => boolean()
    }
  | %{
      :user => t(),
      optional(:include_entities) => boolean(),
      optional(:skip_status) => boolean()
    }

Parameters for block/2.

namedescription
screen_nameThe screen name of the potentially blocked user. Helpful for disambiguating when a valid screen name is also a user ID.
user_idThe ID of the potentially blocked user. Helpful for disambiguating when a valid user ID is also a valid screen name.
include_entitiesThe entities node will not be included when set to false .
skip_statusWhen set to either true , t or 1 statuses will not be included in the returned user objects.

See the Twitter API documentation for details.

Specs

blocked_ids_params() :: %{
  optional(:stringify_ids) => boolean(),
  optional(:cursor) => Tw.V1_1.CursoredResult.cursor()
}

Parameters for blocked_ids /2.

namedescription
stringify_idsMany programming environments will not consume Twitter IDs due to their size. Provide this option to have IDs returned as strings instead. Read more about Twitter IDs .
cursorCauses the list of IDs to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. See Using cursors to navigate collections for more information.

See the Twitter API documentation for details.

Specs

blocked_params() :: %{
  optional(:include_entities) => boolean(),
  optional(:skip_status) => boolean(),
  optional(:cursor) => Tw.V1_1.CursoredResult.cursor()
}

Parameters for blocked/2.

namedescription
include_entitiesThe entities node will not be included when set to false .
skip_statusWhen set to either true , t or 1 statuses will not be included in the returned user objects.
cursorCauses the list of blocked users to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. See Using cursors to navigate collections for more information.

See the Twitter API documentation for details.

Specs

follow_params() ::
  %{:screen_name => screen_name(), optional(:follow) => boolean()}
  | %{:user_id => id(), optional(:follow) => boolean()}
  | %{:user => t(), optional(:follow) => boolean()}

Parameters for follow/2.

namedescription
screen_nameThe screen name of the user to follow.
user_idThe ID of the user to follow.
followEnable notifications for the target user.

See the Twitter API documentation for details.

Specs

follower_ids_params() ::
  %{
    :screen_name => screen_name(),
    optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
    optional(:stringify_ids) => boolean(),
    optional(:count) => pos_integer()
  }
  | %{
      :user_id => id(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:stringify_ids) => boolean(),
      optional(:count) => pos_integer()
    }
  | %{
      :user => t(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:stringify_ids) => boolean(),
      optional(:count) => pos_integer()
    }
  | %{
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:stringify_ids) => boolean(),
      optional(:count) => pos_integer()
    }

Parameters for follower_ids/2.

namedescription
user_idThe ID of the user for whom to return results.
screen_nameThe screen name of the user for whom to return results.
cursorCauses the list of connections to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. See Using cursors to navigate collections for more information.
stringify_idsSome programming environments will not consume Twitter IDs due to their size. Provide this option to have IDs returned as strings instead. More about Twitter IDs.
countSpecifies the number of IDs attempt retrieval of, up to a maximum of 5,000 per distinct request. The value of count is best thought of as a limit to the number of results to return. When using the count parameter with this method, it is wise to use a consistent count value across all requests to the same user's collection. Usage of this parameter is encouraged in environments where all 5,000 IDs constitutes too large of a response.

See the Twitter API documentation for details.

Specs

followers_params() ::
  %{
    :screen_name => screen_name(),
    optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
    optional(:count) => pos_integer(),
    optional(:skip_status) => boolean(),
    optional(:include_user_entities) => boolean()
  }
  | %{
      :user_id => id(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:count) => pos_integer(),
      optional(:skip_status) => boolean(),
      optional(:include_user_entities) => boolean()
    }
  | %{
      :user => t(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:count) => pos_integer(),
      optional(:skip_status) => boolean(),
      optional(:include_user_entities) => boolean()
    }
  | %{
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:count) => pos_integer(),
      optional(:skip_status) => boolean(),
      optional(:include_user_entities) => boolean()
    }

Parameters for followers/2.

namedescription
user_idThe ID of the user for whom to return results.
screen_nameThe screen name of the user for whom to return results.
cursorCauses the results to be broken into pages. If no cursor is provided, a value of -1 will be assumed, which is the first "page."The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. See Using cursors to navigate collections for more information.
countThe number of users to return per page, up to a maximum of 200. Defaults to 20.
skip_statusWhen set to either true, t or 1, statuses will not be included in the returned user objects. If set to any other value, statuses will be included.
include_user_entitiesThe user object entities node will not be included when set to false.

See the Twitter API documentation for details.

Specs

friend_ids_params() ::
  %{
    :screen_name => screen_name(),
    optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
    optional(:stringify_ids) => boolean(),
    optional(:count) => pos_integer()
  }
  | %{
      :user_id => id(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:stringify_ids) => boolean(),
      optional(:count) => pos_integer()
    }
  | %{
      :user => t(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:stringify_ids) => boolean(),
      optional(:count) => pos_integer()
    }
  | %{
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:stringify_ids) => boolean(),
      optional(:count) => pos_integer()
    }

Parameters for friend_ids/2.

namedescription
user_idThe ID of the user for whom to return results.
screen_nameThe screen name of the user for whom to return results.
cursorCauses the list of connections to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. See Using cursors to navigate collections for more information.
stringify_idsSome programming environments will not consume Twitter IDs due to their size. Provide this option to have IDs returned as strings instead. More about Twitter IDs.
countSpecifies the number of IDs attempt retrieval of, up to a maximum of 5,000 per distinct request. The value of count is best thought of as a limit to the number of results to return. When using the count parameter with this method, it is wise to use a consistent count value across all requests to the same user's collection. Usage of this parameter is encouraged in environments where all 5,000 IDs constitutes too large of a response.

See the Twitter API documentation for details.

Specs

friend_relationship() :: %{
  relationship: %{source: relationship_source(), target: relationship_target()}
}

Specs

friends_params() ::
  %{
    :screen_name => screen_name(),
    optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
    optional(:count) => pos_integer(),
    optional(:skip_status) => boolean(),
    optional(:include_user_entities) => boolean()
  }
  | %{
      :user_id => id(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:count) => pos_integer(),
      optional(:skip_status) => boolean(),
      optional(:include_user_entities) => boolean()
    }
  | %{
      :user => t(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:count) => pos_integer(),
      optional(:skip_status) => boolean(),
      optional(:include_user_entities) => boolean()
    }
  | %{
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:count) => pos_integer(),
      optional(:skip_status) => boolean(),
      optional(:include_user_entities) => boolean()
    }

Parameters for friends/2.

namedescription
user_idThe ID of the user for whom to return results.
screen_nameThe screen name of the user for whom to return results.
cursorCauses the results to be broken into pages. If no cursor is provided, a value of -1 will be assumed, which is the first "page."The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. See Using cursors to navigate collections for more information.
countThe number of users to return per page, up to a maximum of 200.
skip_statusWhen set to either true, t or 1 statuses will not be included in the returned user objects.
include_user_entitiesThe user object entities node will not be included when set to false.

See the Twitter API documentation for details.

Specs

friendship() :: %{
  name: binary(),
  screen_name: screen_name(),
  id: id(),
  id_str: binary(),
  connections: [
    :following
    | :following_requested
    | :followed_by
    | :none
    | :blocking
    | :muting
  ]
}
Link to this type

get_friendship_params()

View Source

Specs

get_friendship_params() ::
  %{source_screen_name: screen_name(), target_screen_name: screen_name()}
  | %{source_screen_name: screen_name(), target_id: id()}
  | %{source_screen_name: screen_name(), target: t()}
  | %{source_id: id(), target_screen_name: screen_name()}
  | %{source_id: id(), target_id: id()}
  | %{source_id: id(), target: t()}
  | %{source: t(), target_screen_name: screen_name()}
  | %{source: t(), target_id: id()}
  | %{source: t(), target: t()}

Parameters for get/2.

namedescription
source_idThe user_id of the subject user.
source_screen_nameThe screen_name of the subject user.
target_idThe user_id of the target user.
target_screen_nameThe screen_name of the target user.

See the Twitter API documentation for details.

Specs

get_params() ::
  %{:user_id => id(), optional(:include_entities) => boolean()}
  | %{:screen_name => screen_name(), optional(:include_entities) => boolean()}

Parameters for get/2.

namedescription
user_idThe ID of the user for whom to return results. Either an id or screen_name is required for this method.
screen_nameThe screen name of the user for whom to return results. Either a id or screen_name is required for this method.
include_entitiesThe entities node will not be included when set to false.

See the Twitter API documentation for details.

Link to this type

get_profile_banner_params()

View Source

Specs

get_profile_banner_params() :: Tw.V1_1.Endpoint.user_params()

Parameters for get_profile_banner/2.

namedescription
user_idThe ID of the user for whom to return results. Helpful for disambiguating when a valid user ID is also a valid screen name.
screen_nameThe screen name of the user for whom to return results. Helpful for disambiguating when a valid screen name is also a user ID.

See the Twitter API documentation for details.

Specs

id() :: pos_integer()
Link to this type

list_friendships_params()

View Source

Specs

list_friendships_params() :: Tw.V1_1.Endpoint.user_list_params()

Parameters for list_friendships/2.

namedescription
screen_nameslist of up to 100 screen names
user_idslist of up to 100 user ids
userslist of up to 100 t()

Specs

list_member_params() ::
  %{
    optional(:include_entities) => binary(),
    optional(:skip_status) => boolean(),
    user: t(),
    list: Tw.V1_1.List.t()
  }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user: t(),
      list_id: non_neg_integer()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user: t(),
      slug: binary(),
      owner_id: id()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user: t(),
      slug: binary(),
      owner_screen_name: screen_name()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user_id: id(),
      list: Tw.V1_1.List.t()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user_id: id(),
      list_id: non_neg_integer()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user_id: id(),
      slug: binary(),
      owner_id: id()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user_id: id(),
      slug: binary(),
      owner_screen_name: screen_name()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      screen_name: screen_name(),
      list: Tw.V1_1.List.t()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      screen_name: screen_name(),
      list_id: non_neg_integer()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      screen_name: screen_name(),
      slug: binary(),
      owner_id: id()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      screen_name: screen_name(),
      slug: binary(),
      owner_screen_name: screen_name()
    }

Parameters for list_member/2.

namedescription
list_idThe numerical id of the list.
slugYou can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters.
user_idThe ID of the user for whom to return results. Helpful for disambiguating when a valid user ID is also a valid screen name.
screen_nameThe screen name of the user for whom to return results. Helpful for disambiguating when a valid screen name is also a user ID.
owner_screen_nameThe screen name of the user who owns the list being requested by a slug.
owner_idThe user ID of the user who owns the list being requested by a slug.
include_entitiesWhen set to either true, t or 1, each tweet will include a node called "entities". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future. See Tweet Entities for more details.
skip_statusWhen set to either true, t or 1 statuses will not be included in the returned user objects.

See the Twitter API documentation for details.

Specs

list_members_params() ::
  %{
    :slug => binary(),
    :owner_screen_name => screen_name(),
    optional(:count) => pos_integer(),
    optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
    optional(:include_entities) => boolean(),
    optional(:skip_status) => boolean()
  }
  | %{
      :slug => binary(),
      :owner_id => id(),
      optional(:count) => pos_integer(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:include_entities) => boolean(),
      optional(:skip_status) => boolean()
    }
  | %{
      :list_id => non_neg_integer(),
      optional(:count) => pos_integer(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:include_entities) => boolean(),
      optional(:skip_status) => boolean()
    }
  | %{
      :list => Tw.V1_1.List.t(),
      optional(:count) => pos_integer(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:include_entities) => boolean(),
      optional(:skip_status) => boolean()
    }

Parameters for list_members/2.

namedescription
list_idThe numerical id of the list.
slugYou can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters.
owner_screen_nameThe screen name of the user who owns the list being requested by a slug.
owner_idThe user ID of the user who owns the list being requested by a slug.
countSpecifies the number of results to return per page (see cursor below). The default is 20, with a maximum of 5,000.
cursorCauses the collection of list members to be broken into "pages" of consistent sizes (specified by the count parameter). If no cursor is provided, a value of -1 will be assumed, which is the first "page."
The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. See Using cursors to navigate collections for more information.12893764510938
include_entitiesThe entities node will not be included when set to false.
skip_statusWhen set to either true, t or 1 statuses will not be included in the returned user objects.

See the Twitter API documentation for details.

Specs

list_params() ::
  %{
    :user_ids => [id()],
    optional(:include_entities) => boolean(),
    optional(:tweet_mode) => :compat | :extended
  }
  | %{
      :screen_names => [id()],
      optional(:include_entities) => boolean(),
      optional(:tweet_mode) => :compat | :extended
    }

Parameters for list/2.

namedescription
include_entitiesThe entities node that may appear within embedded statuses will not be included when set to false.
tweet_modeValid request values are compat and extended, which give compatibility mode and extended mode, respectively for Tweets that contain over 140 characters

See the Twitter API documentation for details.

Link to this type

list_subscriber_params()

View Source

Specs

list_subscriber_params() ::
  %{
    optional(:include_entities) => binary(),
    optional(:skip_status) => boolean(),
    user: t(),
    list: Tw.V1_1.List.t()
  }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user: t(),
      list_id: non_neg_integer()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user: t(),
      slug: binary(),
      owner_id: id()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user: t(),
      slug: binary(),
      owner_screen_name: screen_name()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user_id: id(),
      list: Tw.V1_1.List.t()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user_id: id(),
      list_id: non_neg_integer()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user_id: id(),
      slug: binary(),
      owner_id: id()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      user_id: id(),
      slug: binary(),
      owner_screen_name: screen_name()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      screen_name: screen_name(),
      list: Tw.V1_1.List.t()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      screen_name: screen_name(),
      list_id: non_neg_integer()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      screen_name: screen_name(),
      slug: binary(),
      owner_id: id()
    }
  | %{
      optional(:include_entities) => binary(),
      optional(:skip_status) => boolean(),
      screen_name: screen_name(),
      slug: binary(),
      owner_screen_name: screen_name()
    }

Parameters for list_subscriber/2.

namedescription
owner_screen_nameThe screen name of the user who owns the list being requested by a slug.
owner_idThe user ID of the user who owns the list being requested by a slug.
list_idThe numerical id of the list.
slugYou can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters.
user_idThe ID of the user for whom to return results. Helpful for disambiguating when a valid user ID is also a valid screen name.
screen_nameThe screen name of the user for whom to return results. Helpful for disambiguating when a valid screen name is also a user ID.
include_entitiesWhen set to either true, t or 1, each Tweet will include a node called "entities". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future. See Tweet Entities for more details.
skip_statusWhen set to either true , t or 1 statuses will not be included in the returned user objects.

See the Twitter API documentation for details.

Link to this type

list_subscribers_params()

View Source

Specs

list_subscribers_params() ::
  %{
    :slug => binary(),
    :owner_screen_name => screen_name(),
    optional(:count) => pos_integer(),
    optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
    optional(:include_entities) => boolean(),
    optional(:skip_status) => boolean()
  }
  | %{
      :slug => binary(),
      :owner_id => id(),
      optional(:count) => pos_integer(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:include_entities) => boolean(),
      optional(:skip_status) => boolean()
    }
  | %{
      :list_id => non_neg_integer(),
      optional(:count) => pos_integer(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:include_entities) => boolean(),
      optional(:skip_status) => boolean()
    }
  | %{
      :list => Tw.V1_1.List.t(),
      optional(:count) => pos_integer(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:include_entities) => boolean(),
      optional(:skip_status) => boolean()
    }

Parameters for list_subscribers/2.

namedescription
list_idThe numerical id of the list.
slugYou can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters.
owner_screen_nameThe screen name of the user who owns the list being requested by a slug .
owner_idThe user ID of the user who owns the list being requested by a slug .
countSpecifies the number of results to return per page (see cursor below). The default is 20, with a maximum of 5,000.
cursorBreaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. See Using cursors to navigate collections for more information.
include_entitiesWhen set to either true , t or 1 , each tweet will include a node called "entities". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future. See Tweet Entities for more details.
skip_statusWhen set to either true , t or 1 statuses will not be included in the returned user objects.

See the Twitter API documentation for details.

Specs

mute_params() :: Tw.V1_1.Endpoint.user_params()

Parameters for mute/2.

namedescription
screen_nameThe screen name of the potentially muted user. Helpful for disambiguating when a valid screen name is also a user ID.
user_idThe ID of the potentially muted user. Helpful for disambiguating when a valid user ID is also a valid screen name.

See the Twitter API documentation for details.

Specs

muted_ids_params() :: %{
  optional(:stringify_ids) => boolean(),
  optional(:cursor) => Tw.V1_1.CursoredResult.cursor()
}

Parameters for muted_ids /2.

namedescription
stringify_idsMany programming environments will not consume Twitter IDs due to their size. Provide this option to have IDs returned as strings instead. Read more about Twitter IDs .
cursorCauses the list of IDs to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out. If no cursor is provided, a value of -1 will be assumed, which is the first "page."The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. See Using cursors to navigate collections for more information.

See the Twitter API documentation for details.

Specs

muted_params() :: %{
  optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
  optional(:include_entities) => boolean(),
  optional(:skip_status) => boolean()
}

Parameters for muted/2.

namedescription
cursorCauses the list of IDs to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out. If no cursor is provided, a value of -1 will be assumed, which is the first "page."The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. See Using cursors to navigate collections for more information.
include_entitiesThe entities node will not be included when set to false .
skip_statusWhen set to either true , t or 1 statuses will not be included in the returned user objects.

See the Twitter API documentation for details.

Link to this type

no_retweet_ids_params()

View Source

Specs

no_retweet_ids_params() :: %{optional(:stringify_ids) => boolean()}

Parameters for no_retweet_ids/2.

namedescription
stringify_idsSome programming environments will not consume Twitter IDs due to their size. Provide this option to have IDs returned as strings instead. Read more about Twitter IDs. This parameter is important to use in Javascript environments.

See the Twitter API documentation for details.

Link to this type

pending_follower_ids_params()

View Source

Specs

pending_follower_ids_params() :: %{
  optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
  optional(:stringify_ids) => boolean()
}

Parameters for pending_follower_ids/2.

namedescription
cursorCauses the list of connections to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."The response from the API will include a previous_cursor and next_cursor to allow paging back and forth.
stringify_idsMany programming environments will not consume our Tweet ids due to their size. Provide this option to have ids returned as strings instead.

See the Twitter API documentation for details.

Link to this type

pending_friend_ids_params()

View Source

Specs

pending_friend_ids_params() :: %{
  optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
  optional(:stringify_ids) => boolean()
}

Parameters for pending_friend_ids/2.

namedescription
cursorCauses the list of connections to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. See Using cursors to navigate collections for more information.
stringify_idsSome programming environments will not consume Twitter IDs due to their size. Provide this option to have IDs returned as strings instead. More about Twitter IDs.

See the Twitter API documentation for details.

Link to this type

profile_banner_image()

View Source

Specs

profile_banner_image() :: %{
  w: non_neg_integer(),
  h: non_neg_integer(),
  url: binary()
}

Specs

relationship_source() :: %{
  id: id(),
  id_str: binary(),
  screen_name: screen_name(),
  following: boolean(),
  followed_by: boolean(),
  live_following: boolean(),
  following_received: boolean() | nil,
  following_requested: boolean() | nil,
  notifications_enabled: boolean() | nil,
  can_dm: boolean(),
  blocking: boolean() | nil,
  blocked_by: boolean() | nil,
  muting: boolean() | nil,
  want_retweets: boolean() | nil,
  all_replies: boolean() | nil,
  marked_spam: boolean() | nil
}

Specs

relationship_target() :: %{
  id: id(),
  id_str: binary(),
  screen_name: screen_name(),
  following: boolean(),
  followed_by: boolean(),
  following_received: boolean() | nil,
  following_requested: boolean() | nil
}

Specs

report_spam_params() ::
  %{:screen_name => screen_name(), optional(:perform_block) => boolean()}
  | %{:user_id => id(), optional(:perform_block) => boolean()}
  | %{:user => t(), optional(:perform_block) => boolean()}

Parameters for report_spam/2.

namedescription
screen_nameThe screen_name of the user to report as a spammer. Helpful for disambiguating when a valid screen name is also a user ID.
user_idThe ID of the user to report as a spammer. Helpful for disambiguating when a valid user ID is also a valid screen name.
perform_blockWhether the account should be blocked by the authenticated user, as well as being reported for spam.

See the Twitter API documentation for details.

Link to this type

retweeter_ids_params()

View Source

Specs

retweeter_ids_params() ::
  %{
    :tweet_id => Tw.V1_1.Tweet.id(),
    optional(:count) => pos_integer(),
    optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
    optional(:stringify_ids) => boolean()
  }
  | %{
      :tweet => Tw.V1_1.Tweet.t(),
      optional(:count) => pos_integer(),
      optional(:cursor) => Tw.V1_1.CursoredResult.cursor(),
      optional(:stringify_ids) => boolean()
    }

Parameters for retweeter_ids/2.

namedescription
idThe numerical ID of the desired status.
countSpecifies the number of records to retrieve. Must be less than or equal to 100.
cursorCauses the list of IDs to be broken into pages of no more than 100 IDs at a time. The number of IDs returned is not guaranteed to be 100 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. See our cursor docs for more information.While this method supports the cursor parameter, the entire result set can be returned in a single cursored collection. Using the count parameter with this method will not provide segmented cursors for use with this parameter.
stringify_idsMany programming environments will not consume Tweet ids due to their size. Provide this option to have ids returned as strings instead.

See the Twitter API documentation for details.

  • If the tweet is not found, return {:error, error} which satfisfies Tw.V1_1.TwitterAPIError.resource_not_found?(error).

Specs

screen_name() :: binary()

Specs

search_params() :: %{
  :q => binary(),
  optional(:page) => non_neg_integer(),
  optional(:count) => pos_integer(),
  optional(:include_entities) => boolean()
}

Parameters for search/2.

namedescription
qThe search query to run against people search.
pageSpecifies the page of results to retrieve.
countThe number of potential user results to retrieve per page. This value has a maximum of 20.
include_entitiesThe entities node will not be included in embedded Tweet objects when set to false .

See the Twitter API documentation for details.

Specs

t() :: %Tw.V1_1.User{
  created_at: DateTime.t(),
  default_profile: boolean(),
  default_profile_image: boolean(),
  derived: [map()] | nil,
  description: binary() | nil,
  entities: Tw.V1_1.UserEntities.t() | nil,
  favourites_count: integer(),
  followers_count: integer(),
  friends_count: integer(),
  id: integer(),
  id_str: binary(),
  listed_count: integer(),
  location: binary() | nil,
  name: binary(),
  profile_banner_url: binary() | nil,
  profile_image_url_https: binary(),
  protected: boolean(),
  screen_name: binary(),
  statuses_count: integer(),
  url: binary() | nil,
  verified: boolean(),
  withheld_in_countries: [binary()] | nil,
  withheld_scope: binary() | nil
}
fielddescription
idThe integer representation of the unique identifier for this User. This number is greater than 53 bits and some programming languages may have difficulty/silent defects in interpreting it. Using a signed 64 bit integer for storing this identifier is safe. Use id_str to fetch the identifier to be safe. See Twitter IDs for more information. Example: 6253282.
id_strThe string representation of the unique identifier for this User. Implementations should use this rather than the large, possibly un-consumable integer in id. Example: "6253282".
nameThe name of the user, as they’ve defined it. Not necessarily a person’s name. Typically capped at 50 characters, but subject to change. Example: "Twitter API".
screen_nameThe screen name, handle, or alias that this user identifies themselves with. screen_names are unique but subject to change. Use id_str as a user identifier whenever possible. Typically a maximum of 15 characters long, but some historical accounts may exist with longer names. Example: "twitterapi".
locationNullable . The user-defined location for this account’s profile. Not necessarily a location, nor machine-parseable. This field will occasionally be fuzzily interpreted by the Search service. Example: "San Francisco, CA".
derivedEnterprise APIs only Collection of Enrichment metadata derived for user. Provides the Profile Geo Enrichment metadata. See referenced documentation for more information, including JSON data dictionaries. Example: {"locations": [{"country":"United States","country_code":"US","locality":"Denver"}]}.
urlNullable . A URL provided by the user in association with their profile. Example: "https://developer.twitter.com".
descriptionNullable . The user-defined UTF-8 string describing their account. Example: "The Real Twitter API.".
protectedWhen true, indicates that this user has chosen to protect their Tweets. See About Public and Protected Tweets . Example: true.
verifiedWhen true, indicates that the user has a verified account. See Verified Accounts . Example: false.
followers_countThe number of followers this account currently has. Under certain conditions of duress, this field will temporarily indicate “0”. Example: 21.
friends_countThe number of users this account is following (AKA their “followings”). Under certain conditions of duress, this field will temporarily indicate “0”. Example: 32.
listed_countThe number of public lists that this user is a member of. Example: 9274.
favourites_countThe number of Tweets this user has liked in the account’s lifetime. British spelling used in the field name for historical reasons. Example: 13.
statuses_countThe number of Tweets (including retweets) issued by the user. Example: 42.
created_atThe UTC datetime that the user account was created on Twitter. Example: "Mon Nov 29 21:18:15 +0000 2010".
profile_banner_urlThe HTTPS-based URL pointing to the standard web representation of the user’s uploaded profile banner. By adding a final path element of the URL, it is possible to obtain different image sizes optimized for specific displays. For size variants, please see User Profile Images and Banners .Example: "https://si0.twimg.com/profile_banners/819797/1348102824".
profile_image_url_httpsA HTTPS-based URL pointing to the user’s profile image. Example: "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png".
default_profileWhen true, indicates that the user has not altered the theme or background of their user profile. Example: false.
default_profile_imageWhen true, indicates that the user has not uploaded their own profile image and a default image is used instead. Example: false.
withheld_in_countriesWhen present, indicates a list of uppercase two-letter country codes this content is withheld from. Twitter supports the following non-country values for this field:“XX” - Content is withheld in all countries “XY” - Content is withheld due to a DMCA request.Example: ["GR", "HK", "MY"].
withheld_scopeWhen present, indicates that the content being withheld is a “user.”Example: "user".
entities-

Specs

unblock_params() ::
  %{
    :screen_name => screen_name(),
    optional(:include_entities) => boolean(),
    optional(:skip_status) => boolean()
  }
  | %{
      :user_id => id(),
      optional(:include_entities) => boolean(),
      optional(:skip_status) => boolean()
    }
  | %{
      :user => t(),
      optional(:include_entities) => boolean(),
      optional(:skip_status) => boolean()
    }

Parameters for unblock/2.

namedescription
screen_nameThe screen name of the potentially blocked user. Helpful for disambiguating when a valid screen name is also a user ID.
user_idThe ID of the potentially blocked user. Helpful for disambiguating when a valid user ID is also a valid screen name.
include_entitiesThe entities node will not be included when set to false .
skip_statusWhen set to either true , t or 1 statuses will not be included in the returned user objects.

See the Twitter API documentation for details.

Specs

unfollow_params() :: Tw.V1_1.Endpoint.user_params()

Parameters for unfollow/2.

namedescription
screen_nameThe screen name of the user to unfollow.
user_idThe ID of the user to unfollow.

See the Twitter API documentation for details.

Specs

unmute_params() :: Tw.V1_1.Endpoint.user_params()

Parameters for unmute/2.

namedescription
screen_nameThe screen name of the potentially muted user. Helpful for disambiguating when a valid screen name is also a user ID.
user_idThe ID of the potentially muted user. Helpful for disambiguating when a valid user ID is also a valid screen name.

See the Twitter API documentation for details.

Link to this type

update_friendship_params()

View Source

Specs

update_friendship_params() ::
  %{
    :screen_name => screen_name(),
    optional(:device) => boolean(),
    optional(:retweets) => boolean()
  }
  | %{
      :user_id => id(),
      optional(:device) => boolean(),
      optional(:retweets) => boolean()
    }
  | %{
      :user => t(),
      optional(:device) => boolean(),
      optional(:retweets) => boolean()
    }

Parameters for update_friendship/2.

namedescription
screen_nameThe screen name of the user being followed.
user_idThe ID of the user being followed.
deviceTurn on/off device notifications from the target user.
retweetsTurn on/off Retweets from the target user.

See the Twitter API documentation for details.

Link to this section Functions

Specs

block(Tw.V1_1.Client.t(), block_params()) ::
  {:ok, t()} | {:error, Tw.V1_1.Client.error()}

Request POST /blocks/create.json and return decoded result.

Blocks the specified user from following the authenticating user. In addition the blocked user will not show in the authenticating users mentions or timeline (unless retweeted by another user). If a follow or friend relationship exists it is destroyed.

The URL pattern /version/block/create/:screen_name_or_user_id.format is still accepted but not recommended. As a sequence of numbers is a valid screen name we recommend using the screen_name or user_id parameter instead.

See the Twitter API documentation for details.

Link to this function

blocked(client, params \\ %{})

View Source

Specs

blocked(Tw.V1_1.Client.t(), blocked_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:users, [t()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /blocks/list.json and return decoded result.

Returns a collection of user objects that the authenticating user is blocking.

Important This method is cursored, meaning your app must make multiple requests in order to receive all blocks correctly. See Using cursors to navigate collections for more details on how cursoring works.

See the Twitter API documentation for details.

Link to this function

blocked_ids(client, params \\ %{})

View Source

Specs

blocked_ids(Tw.V1_1.Client.t(), blocked_ids_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:ids, [id()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /blocks/ids.json and return decoded result.

Returns an array of numeric user ids the authenticating user is blocking.

Important This method is cursored, meaning your app must make multiple requests in order to receive all blocks correctly. See Using cursors to navigate collections for more details on how cursoring works.

See the Twitter API documentation for details.

Specs

decode!(map()) :: t()

Decode JSON-decoded map into t/0

Specs

follow(Tw.V1_1.Client.t(), follow_params()) ::
  {:ok, t()} | {:error, Tw.V1_1.Client.error()}

Request POST /friendships/create.json and return decoded result.

Allows the authenticating user to follow (friend) the user specified in the ID parameter.

Returns the followed user when successful. Returns a string describing the failure condition when unsuccessful. If the user is already friends with the user a HTTP 403 may be returned, though for performance reasons this method may also return a HTTP 200 OK message even if the follow relationship already exists.

Actions taken in this method are asynchronous. Changes will be eventually consistent.

See the Twitter API documentation for details.

Link to this function

follower_ids(client, params \\ %{})

View Source

Specs

follower_ids(Tw.V1_1.Client.t(), follower_ids_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:ids, [id()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /followers/ids.json and return decoded result.

Returns a cursored collection of user IDs for every user following the specified user.

At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues. Results are given in groups of 5,000 user IDs and multiple "pages" of results can be navigated through using the next_cursor value in subsequent requests. See Using cursors to navigate collections for more information.

This method is especially powerful when used in conjunction with GET users / lookup, a method that allows you to convert user IDs into full user objects in bulk.

See the Twitter API documentation for details.

If no user found by the parameter, return {:error, error} which satfisfies Tw.V1_1.TwitterAPIError.resource_not_found?(error).

Link to this function

followers(client, params)

View Source

Specs

followers(Tw.V1_1.Client.t(), followers_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:users, [t()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /followers/list.json and return decoded result.

Returns a cursored collection of user objects for users following the specified user.

At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues. Results are given in groups of 20 users and multiple "pages" of results can be navigated through using the next_cursor value in subsequent requests. See Using cursors to navigate collections for more information.

See the Twitter API documentation for details.

Link to this function

friend_ids(client, params \\ %{})

View Source

Specs

friend_ids(Tw.V1_1.Client.t(), friend_ids_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:ids, [id()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /friends/ids.json and return decoded result.

Returns a cursored collection of user IDs for every user the specified user is following (otherwise known as their "friends").

At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues. Results are given in groups of 5,000 user IDs and multiple "pages" of results can be navigated through using the next_cursor value in subsequent requests. See Using cursors to navigate collections for more information.

This method is especially powerful when used in conjunction with GET users / lookup, a method that allows you to convert user IDs into full user objects in bulk.

See the Twitter API documentation for details.

Specs

friends(Tw.V1_1.Client.t(), friends_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:users, [t()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /friends/list.json and return decoded result.

Returns a cursored collection of user objects for every user the specified user is following (otherwise known as their "friends").

At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues. Results are given in groups of 20 users and multiple "pages" of results can be navigated through using the next_cursor value in subsequent requests. See Using cursors to navigate collections for more information.

See the Twitter API documentation for details.

Specs

get(Tw.V1_1.Client.t(), get_params()) ::
  {:ok, t() | nil} | {:error, Tw.V1_1.Client.error()}

Request GET /users/show.json and return decoded result.

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

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 current_status field.

See the Twitter API documentation for details.

If no user found by the given parameters, return {:ok, nil}.

If you want to retreive multiple users, use list/2.

Link to this function

get_friendship(client, params)

View Source

Specs

get_friendship(Tw.V1_1.Client.t(), get_friendship_params()) ::
  {:ok, friend_relationship()} | {:error, Tw.V1_1.Client.error()}

Request GET /friendships/show.json and return decoded result.

Returns detailed information about the relationship between two arbitrary users.

See the Twitter API documentation for details.

Link to this function

get_profile_banner(client, params)

View Source

Specs

get_profile_banner(Tw.V1_1.Client.t(), get_profile_banner_params()) ::
  {:ok,
   %{
     sizes: %{
       ipad: profile_banner_image(),
       ipad_retina: profile_banner_image(),
       web: profile_banner_image(),
       web_retina: profile_banner_image(),
       mobile: profile_banner_image(),
       mobile_retina: profile_banner_image(),
       "300x100": profile_banner_image(),
       "600x200": profile_banner_image(),
       "1500x500": profile_banner_image()
     }
   }
   | nil}
  | {:error, Tw.V1_1.Client.error()}

Request GET /users/profile_banner.json and return decoded result.

Returns a map of the available size variations of the specified user's profile banner. If the user has not uploaded a profile banner, a HTTP 404 will be served instead. This method can be used instead of string manipulation on the profile_banner_url returned in user objects as described in Profile Images and Banners.

The profile banner data available at each size variant's URL is in PNG format.

See the Twitter API documentation for details.

If the user has not profile banner , return {:ok, nil}. If no user is found by the parameter, return {:error, error} which satfisfies Tw.V1_1.TwitterAPIError.user_not_found?(error).

Specs

list(Tw.V1_1.Client.t(), list_params()) ::
  {:ok, [t()]} | {:error, Tw.V1_1.Client.error()}

Request GET /users/lookup.json and return decoded result.

Returns fully-hydrated user objects for up to 100 users per request, as specified by comma-separated values passed to the user_id and/or screen_name parameters.

This method is especially useful when used in conjunction with collections of user IDs returned from GET friends / ids and GET followers / ids.

GET users / show is used to retrieve a single user object.

There are a few things to note when using this method.

You must be following a protected user to be able to see their most recent status update. If you don't follow a protected user their status will be removed.The order of user IDs or screen names may not match the order of users in the returned array.If a requested user is unknown, suspended, or deleted, then that user will not be returned in the results list.If none of your lookup criteria can be satisfied by returning a user object, a HTTP 404 will be thrown.You are strongly encouraged to use a POST for larger requests.

See the Twitter API documentation for details.

If no user found by the given parameters, return {:ok, []}.

Link to this function

list_friendships(client, params)

View Source

Specs

list_friendships(Tw.V1_1.Client.t(), list_friendships_params()) ::
  {:ok, [friendship()]} | {:error, Tw.V1_1.Client.error()}

Request GET /friendships/lookup.json and return decoded result.

Returns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided. Values for connections can be: following, following_requested, followed_by, none, blocking, muting.

See the Twitter API documentation for details.

Link to this function

list_member(client, params)

View Source

Specs

list_member(Tw.V1_1.Client.t(), list_member_params()) ::
  {:ok, t() | nil} | {:error, Tw.V1_1.Client.error()}

Check if the specified user is a member of the specified list.

Request GET /lists/members/show.json and return decoded result.

  • If the list is not found, return {:error, error} which satfisfies Tw.V1_1.TwitterAPIError.resource_not_found?(error).
  • If the user is not member of the list, return {:error, error} which satfisfies Tw.V1_1.TwitterAPIError.member_not_found?(error).

See the Twitter API documentation for details.

Link to this function

list_members(client, params)

View Source

Specs

list_members(Tw.V1_1.Client.t(), list_members_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:users, [t()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /lists/members.json and return decoded result.

members/*

Returns the members of the specified list. Private list members will only be shown if the authenticated user owns the specified list.

See the Twitter API documentation for details.

Link to this function

list_subscriber(client, params)

View Source

Specs

list_subscriber(Tw.V1_1.Client.t(), list_subscriber_params()) ::
  {:ok, t()} | {:error, Tw.V1_1.Client.error()}

Check if the specified user is a subscriber of the specified list. Returns the user if they are a subscriber.

Request GET /lists/subscribers/show.json and return decoded result.

  • If the list is not found, return {:error, error} which satfisfies Tw.V1_1.TwitterAPIError.resource_not_found?(error).
  • If the user is not subscriber of the list, return {:error, error} which satfisfies Tw.V1_1.TwitterAPIError.subscriber_not_found?(error).

See the Twitter API documentation for details.

Link to this function

list_subscribers(client, params)

View Source

Specs

list_subscribers(Tw.V1_1.Client.t(), list_subscribers_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:users, [t()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /lists/subscribers.json and return decoded result.

subscribers/*

Returns the subscribers of the specified list. Private list subscribers will only be shown if the authenticated user owns the specified list.

See the Twitter API documentation for details.

Link to this function

me(client, params \\ %{})

View Source

See Tw.V1_1.Me.get/2.

Specs

mute(Tw.V1_1.Client.t(), mute_params()) ::
  {:ok, t()} | {:error, Tw.V1_1.Client.error()}

Request POST /mutes/users/create.json and return decoded result.

Mutes the user specified in the ID parameter for the authenticating user.

Returns the muted user when successful. Returns a string describing the failure condition when unsuccessful.

Actions taken in this method are asynchronous. Changes will be eventually consistent.

See the Twitter API documentation for details.

Link to this function

muted(client, params \\ %{})

View Source

Specs

muted(Tw.V1_1.Client.t(), muted_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:users, [t()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /mutes/users/list.json and return decoded result.

Returns an array of user objects the authenticating user has muted.

See the Twitter API documentation for details.

Link to this function

muted_ids(client, params \\ %{})

View Source

Specs

muted_ids(Tw.V1_1.Client.t(), muted_ids_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:ids, [integer()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /mutes/users/ids.json and return decoded result.

Returns an array of numeric user ids the authenticating user has muted.

See the Twitter API documentation for details.

Link to this function

no_retweet_ids(client, params \\ %{})

View Source

Specs

no_retweet_ids(Tw.V1_1.Client.t(), no_retweet_ids_params()) ::
  {:ok, [id()]} | {:error, Tw.V1_1.Client.error()}

Request GET /friendships/no_retweets/ids.json and return decoded result.

Returns a collection of user_ids that the currently authenticated user does not want to receive retweets from.

Use POST friendships / update to set the "no retweets" status for a given user account on behalf of the current user.

See the Twitter API documentation for details.

Link to this function

pending_follower_ids(client, params \\ %{})

View Source

Specs

pending_follower_ids(Tw.V1_1.Client.t(), pending_follower_ids_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:ids, [id()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /friendships/incoming.json and return decoded result.

Returns a collection of numeric IDs for every user who has a pending request to follow the authenticating user.

See the Twitter API documentation for details.

Link to this function

pending_friend_ids(client, params \\ %{})

View Source

Specs

pending_friend_ids(Tw.V1_1.Client.t(), pending_friend_ids_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:ids, [id()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /friendships/outgoing.json and return decoded result.

Returns a collection of numeric IDs for every protected user for whom the authenticating user has a pending follow request.

See the Twitter API documentation for details.

Link to this function

preprocess_source_params(params)

View Source
Link to this function

preprocess_target_params(params)

View Source
Link to this function

report_spam(client, params)

View Source

Specs

report_spam(Tw.V1_1.Client.t(), report_spam_params()) ::
  {:ok, t()} | {:error, Tw.V1_1.Client.error()}

Request POST /users/report_spam.json and return decoded result.

Report the specified user as a spam account to Twitter. Additionally, optionally performs the equivalent of POST blocks / create on behalf of the authenticated user.

See the Twitter API documentation for details.

Link to this function

retweeter_ids(client, params)

View Source

Specs

retweeter_ids(Tw.V1_1.Client.t(), retweeter_ids_params()) ::
  {:ok, Tw.V1_1.CursoredResult.t(:ids, [id()])}
  | {:error, Tw.V1_1.Client.error()}

Request GET /statuses/retweeters/ids.json and return decoded result.

Returns a collection of up to 100 user IDs belonging to users who have retweeted the Tweet specified by the id parameter.

This method offers similar data to GET statuses / retweets / :id.

See the Twitter API documentation for details.

Specs

search(Tw.V1_1.Client.t(), search_params()) ::
  {:ok, [t()]} | {:error, Tw.V1_1.Client.error()}

Request GET /users/search.json and return decoded result.

Provides a simple, relevance-based search interface to public user accounts on Twitter. Try querying by topical interest, full name, company name, location, or other criteria. Exact match searches are not supported.

Only the first 1,000 matching results are available.

See the Twitter API documentation for details.

If no user found by the given parameters, return {:ok, []}.

Specs

unblock(Tw.V1_1.Client.t(), unblock_params()) ::
  {:ok, t()} | {:error, Tw.V1_1.Client.error()}

Request POST /blocks/destroy.json and return decoded result.

Un-blocks the user specified in the ID parameter for the authenticating user. Returns the un-blocked user when successful. If relationships existed before the block was instantiated, they will not be restored.

See the Twitter API documentation for details.

Link to this function

unfollow(client, params)

View Source

Specs

unfollow(Tw.V1_1.Client.t(), unfollow_params()) ::
  {:ok, t()} | {:error, Tw.V1_1.Client.error()}

Request POST /friendships/destroy.json and return decoded result.

Allows the authenticating user to unfollow the user specified in the ID parameter.

Returns the unfollowed user when successful. Returns a string describing the failure condition when unsuccessful.

Actions taken in this method are asynchronous. Changes will be eventually consistent.

See the Twitter API documentation for details.

Specs

unmute(Tw.V1_1.Client.t(), unmute_params()) ::
  {:ok, t()} | {:error, Tw.V1_1.Client.error()}

Request POST /mutes/users/destroy.json and return decoded result.

Un-mutes the user specified in the ID parameter for the authenticating user.

Returns the unmuted user when successful. Returns a string describing the failure condition when unsuccessful.

Actions taken in this method are asynchronous. Changes will be eventually consistent.

See the Twitter API documentation for details.

Link to this function

update_friendship(client, params)

View Source

Specs

update_friendship(Tw.V1_1.Client.t(), update_friendship_params()) ::
  {:ok, friend_relationship()} | {:error, Tw.V1_1.Client.error()}

Request POST /friendships/update.json and return decoded result.

Turn on/off Retweets and device notifications from the specified user.

See the Twitter API documentation for details.