Skip to main content

Submodules

Module contents

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

class xdk.lists.ListsClient

Client for lists operations

Parameters

path.client
Client

__init__

Parameters

path.client
Client

add_member

Add List member Adds a User to a specific List by its ID.

Parameters

path.id
Any
The ID of the List for which to add a member.
body.body
AddMemberRequest
Request body

create

Create List Creates a new List for the authenticated user. body: Request body :returns: Response data :rtype: CreateResponse

Parameters

body.body
CreateRequest

delete

Delete List Deletes a specific List owned by the authenticated user by its ID.

Parameters

path.id
Any
The ID of the List to delete.

Returns

DeleteResponse - Response data

get_by_id

Get List by ID Retrieves details of a specific List by its ID.

Parameters

path.id
Any
The ID of the List.
path.list_fields
List or None
default:"None"
A comma separated list of List fields to display.
path.expansions
List or None
default:"None"
A comma separated list of fields to expand.
path.user_fields
List or None
default:"None"
A comma separated list of User fields to display.

Returns

GetByIdResponse - Response data

get_followers

Get List followers Retrieves a list of Users who follow a specific List by its ID.

Parameters

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

Returns

GetFollowersResponse - Response data

get_members

Get List members Retrieves a list of Users who are members of a specific List by its ID.

Parameters

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

Returns

GetMembersResponse - Response data

get_posts

Get List Posts Retrieves a list of Posts associated with a specific List by its ID.

Parameters

path.id
Any
The ID of the List.
path.max_results
int or None
default:"None"
The maximum number of results.
path.pagination_token
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
path.tweet_fields
List or None
default:"None"
A comma separated list of Tweet fields to display.
path.expansions
List or None
default:"None"
A comma separated list of fields to expand.
path.media_fields
List or None
default:"None"
A comma separated list of Media fields to display.
path.poll_fields
List or None
default:"None"
A comma separated list of Poll fields to display.
path.user_fields
List or None
default:"None"
A comma separated list of User fields to display.
path.place_fields
List or None
default:"None"
A comma separated list of Place fields to display.

Returns

GetPostsResponse - Response data

remove_member_by_user_id

Remove List member Removes a User from a specific List by its ID and the User’s ID.

Parameters

path.id
Any
The ID of the List to remove a member.
path.user_id
Any
The ID of User that will be removed from the List.

Returns

RemoveMemberByUserIdResponse - Response data

update

Update List Updates the details of a specific List owned by the authenticated user by its ID.

Parameters

path.id
Any
The ID of the List to modify.
body.body
UpdateRequest
Request body