Skip to main content

Submódulos

Conteúdo do módulo

Este módulo fornece acesso aos endpoints users da X API e serve como o principal ponto de entrada para toda a funcionalidade relacionada a users.

class xdk.users.UsersClient

Client para operações de users

Parâmetros

Client

__init__

Parâmetros

Client

block_dms

Block DMs Blocks direct messages to or from a specific User by their ID for the authenticated user.

Parâmetros

Any
The ID of the target User that the authenticated user requesting to block dms for.

Retorna

BlockDmsResponse - Response data

create_bookmark

Create Bookmark Adds a post to the authenticated user’s bookmarks.

Parâmetros

Any
The ID of the authenticated source User for whom to add bookmarks.
CreateBookmarkRequest
Request body

delete_bookmark

Delete Bookmark Removes a Post from the authenticated user’s Bookmarks by its ID.

Parâmetros

Any
The ID of the authenticated source User whose bookmark is to be removed.
Any
The ID of the Post that the source User is removing from bookmarks.

Retorna

DeleteBookmarkResponse - Response data

follow_list

Follow List Causes the authenticated user to follow a specific List by its ID.

Parâmetros

Any
The ID of the authenticated source User that will follow the List.
FollowListRequest
Request body

follow_user

Follow User Causes the authenticated user to follow a specific user by their ID.

Parâmetros

Any
The ID of the authenticated source User that is requesting to follow the target User.
FollowUserRequest
Request body

get_blocking

Get blocking Retrieves a list of Users blocked by the specified User ID.

Parâmetros

Any
The ID of the authenticated source User for whom to return results.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.

Retorna

IteratorGetBlockingResponse

get_bookmark_folders

Get Bookmark folders Retrieves a list of Bookmark folders created by the authenticated user.

Parâmetros

Any
The ID of the authenticated source User for whom to return results.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.

Retorna

IteratorGetBookmarkFoldersResponse

get_bookmarks

Get Bookmarks Retrieves a list of Posts bookmarked by the authenticated user.

Parâmetros

Any
The ID of the authenticated source User for whom to return results.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.

Retorna

IteratorGetBookmarksResponse

get_bookmarks_by_folder_id

Get Bookmarks by folder ID Retrieves Posts in a specific Bookmark folder by its ID for the authenticated user.

Parâmetros

Any
The ID of the authenticated source User for whom to return results.
Any
The ID of the Bookmark Folder that the authenticated User is trying to fetch Posts for.

Retorna

GetBookmarksByFolderIdResponse - Response data

get_by_id

Get User by ID Retrieves details of a specific User by their ID.

Parâmetros

Any
The ID of the User to lookup.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.

Retorna

GetByIdResponse - Response data

get_by_ids

Get Users by IDs Retrieves details of multiple Users by their IDs.

Parâmetros

List
A list of User IDs, comma-separated. You can specify up to 100 IDs.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.

Retorna

GetByIdsResponse - Response data

get_by_username

Get User by username Retrieves details of a specific User by their username.

Parâmetros

str
A username.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.

Retorna

GetByUsernameResponse - Response data

get_by_usernames

Get Users by usernames Retrieves details of multiple Users by their usernames.

Parâmetros

List
A list of usernames, comma-separated.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.

Retorna

GetByUsernamesResponse - Response data

get_followed_lists

Get followed Lists Retrieves a list of Lists followed by a specific User by their ID.

Parâmetros

Any
The ID of the User to lookup.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
A comma separated list of List fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of User fields to display.

Retorna

IteratorGetFollowedListsResponse

get_followers

Get followers Retrieves a list of Users who follow a specific User by their ID.

Parâmetros

Any
The ID of the User to lookup.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.

Retorna

IteratorGetFollowersResponse

get_following

Get following Retrieves a list of Users followed by a specific User by their ID.

Parâmetros

Any
The ID of the User to lookup.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.

Retorna

IteratorGetFollowingResponse

get_liked_posts

Get liked Posts Retrieves a list of Posts liked by a specific User by their ID.

Parâmetros

Any
The ID of the User to lookup.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.

Retorna

IteratorGetLikedPostsResponse

get_list_memberships

Get List memberships Retrieves a list of Lists that a specific User is a member of by their ID.

Parâmetros

Any
The ID of the User to lookup.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
A comma separated list of List fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of User fields to display.

Retorna

IteratorGetListMembershipsResponse

get_me

Get my User Retrieves details of the authenticated user.

Parâmetros

List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.

Retorna

GetMeResponse - Response data

get_mentions

Get mentions Retrieves a list of Posts that mention a specific User by their ID.

Parâmetros

Any
The ID of the User to lookup.
Any or None
default:"None"
The minimum Post ID to be included in the result set. This parameter takes precedence over start_time if both are specified.
Any or None
default:"None"
The maximum Post ID to be included in the result set. This parameter takes precedence over end_time if both are specified.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Posts will be provided. The since_id parameter takes precedence if it is also specified.
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided. The until_id parameter takes precedence if it is also specified.
List or None
default:"None"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.

Retorna

IteratorGetMentionsResponse

get_muting

Get muting Retrieves a list of Users muted by the authenticated user.

Parâmetros

Any
The ID of the authenticated source User for whom to return results.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.

Retorna

IteratorGetMutingResponse

get_owned_lists

Get owned Lists Retrieves a list of Lists owned by a specific User by their ID.

Parâmetros

Any
The ID of the User to lookup.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
A comma separated list of List fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of User fields to display.

Retorna

IteratorGetOwnedListsResponse

get_pinned_lists

Get pinned Lists Retrieves a list of Lists pinned by the authenticated user.

Parâmetros

Any
The ID of the authenticated source User for whom to return results.
List or None
default:"None"
A comma separated list of List fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of User fields to display.

Retorna

GetPinnedListsResponse - Response data

get_posts

Get Posts Retrieves a list of posts authored by a specific User by their ID.

Parâmetros

Any
The ID of the User to lookup.
Any or None
default:"None"
The minimum Post ID to be included in the result set. This parameter takes precedence over start_time if both are specified.
Any or None
default:"None"
The maximum Post ID to be included in the result set. This parameter takes precedence over end_time if both are specified.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
The set of entities to exclude (e.g. ‘replies’ or ‘retweets’).
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Posts will be provided. The since_id parameter takes precedence if it is also specified.
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided. The until_id parameter takes precedence if it is also specified.
List or None
default:"None"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.

Retorna

IteratorGetPostsResponse

get_reposts_of_me

Get Reposts of me Retrieves a list of Posts that repost content from the authenticated user.

Parâmetros

int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.

Retorna

IteratorGetRepostsOfMeResponse

get_timeline

Get Timeline Retrieves a reverse chronological list of Posts in the authenticated User’s Timeline.

Parâmetros

Any
The ID of the authenticated source User to list Reverse Chronological Timeline Posts of.
Any or None
default:"None"
The minimum Post ID to be included in the result set. This parameter takes precedence over start_time if both are specified.
Any or None
default:"None"
The maximum Post ID to be included in the result set. This parameter takes precedence over end_time if both are specified.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
The set of entities to exclude (e.g. ‘replies’ or ‘retweets’).
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Posts will be provided. The since_id parameter takes precedence if it is also specified.
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided. The until_id parameter takes precedence if it is also specified.
List or None
default:"None"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.

Retorna

IteratorGetTimelineResponse

like_post

Like Post Causes the authenticated user to Like a specific Post by its ID.

Parâmetros

Any
The ID of the authenticated source User that is requesting to like the Post.
LikePostRequest
Request body

mute_user

Mute User Causes the authenticated user to mute a specific User by their ID.

Parâmetros

Any
The ID of the authenticated source User that is requesting to mute the target User.
MuteUserRequest
Request body

pin_list

Pin List Causes the authenticated user to pin a specific List by its ID.

Parâmetros

Any
The ID of the authenticated source User that will pin the List.
PinListRequest
Request body

repost_post

Repost Post Causes the authenticated user to repost a specific Post by its ID.

Parâmetros

Any
The ID of the authenticated source User that is requesting to repost the Post.
RepostPostRequest
Request body
Search Users Retrieves a list of Users matching a search query.

Parâmetros

Any
TThe the query string by which to query for users.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.

Retorna

IteratorSearchResponse

unblock_dms

Unblock DMs Unblocks direct messages to or from a specific User by their ID for the authenticated user.

Parâmetros

Any
The ID of the target User that the authenticated user requesting to unblock dms for.

Retorna

UnblockDmsResponse - Response data

unfollow_list

Unfollow List Causes the authenticated user to unfollow a specific List by its ID.

Parâmetros

Any
The ID of the authenticated source User that will unfollow the List.
Any
The ID of the List to unfollow.

Retorna

UnfollowListResponse - Response data

unfollow_user

Unfollow User Causes the authenticated user to unfollow a specific user by their ID.

Parâmetros

Any
The ID of the authenticated source User that is requesting to unfollow the target User.
Any
The ID of the User that the source User is requesting to unfollow.

Retorna

UnfollowUserResponse - Response data

unlike_post

Unlike Post Causes the authenticated user to Unlike a specific Post by its ID.

Parâmetros

Any
The ID of the authenticated source User that is requesting to unlike the Post.
Any
The ID of the Post that the User is requesting to unlike.

Retorna

UnlikePostResponse - Response data

unmute_user

Unmute User Causes the authenticated user to unmute a specific user by their ID.

Parâmetros

Any
The ID of the authenticated source User that is requesting to unmute the target User.
Any
The ID of the User that the source User is requesting to unmute.

Retorna

UnmuteUserResponse - Response data

unpin_list

Unpin List Causes the authenticated user to unpin a specific List by its ID.

Parâmetros

Any
The ID of the authenticated source User for whom to return results.
Any
The ID of the List to unpin.

Retorna

UnpinListResponse - Response data

unrepost_post

Unrepost Post Causes the authenticated user to unrepost a specific Post by its ID.

Parâmetros

Any
The ID of the authenticated source User that is requesting to repost the Post.
Any
The ID of the Post that the User is requesting to unretweet.

Retorna

UnrepostPostResponse - Response data