Skip to main content

Submódulos

Contenido del módulo

This module provides access to the users endpoints of the X API and serves as the main entry point for all users-related functionality.

class xdk.users.UsersClient

Cliente para operaciones 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.

Devuelve

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.

Devuelve

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"
El número máximo de resultados.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.

Devuelve

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"
El número máximo de resultados.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.

Devuelve

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"
El número máximo de resultados.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Media a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Poll a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Place a mostrar.

Devuelve

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.

Devuelve

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"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.

Devuelve

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"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.

Devuelve

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"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.

Devuelve

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"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.

Devuelve

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"
El número máximo de resultados.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
Una lista separada por comas de campos de List a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.

Devuelve

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"
El número máximo de resultados.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.

Devuelve

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"
El número máximo de resultados.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.

Devuelve

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"
El número máximo de resultados.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Media a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Poll a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Place a mostrar.

Devuelve

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"
El número máximo de resultados.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
Una lista separada por comas de campos de List a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.

Devuelve

IteratorGetListMembershipsResponse

get_me

Get my User Retrieves details of the authenticated user.

Parámetros

List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.

Devuelve

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"
El número máximo de resultados.
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"
Una lista separada por comas de campos de Tweet a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Media a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Poll a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Place a mostrar.

Devuelve

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"
El número máximo de resultados.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.

Devuelve

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"
El número máximo de resultados.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
Una lista separada por comas de campos de List a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.

Devuelve

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"
Una lista separada por comas de campos de List a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.

Devuelve

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"
El número máximo de resultados.
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"
Una lista separada por comas de campos de Tweet a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Media a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Poll a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Place a mostrar.

Devuelve

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"
El número máximo de resultados.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Media a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Poll a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Place a mostrar.

Devuelve

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"
El número máximo de resultados.
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"
Una lista separada por comas de campos de Tweet a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Media a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Poll a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos de Place a mostrar.

Devuelve

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"
El número máximo de resultados.
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"
Una lista separada por comas de campos de User a mostrar.
List or None
default:"None"
Una lista separada por comas de campos para expandir.
List or None
default:"None"
Una lista separada por comas de campos de Tweet a mostrar.

Devuelve

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.

Devuelve

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.

Devuelve

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.

Devuelve

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.

Devuelve

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.

Devuelve

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.

Devuelve

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.

Devuelve

UnrepostPostResponse - Response data