Skip to main content

Submodules

Module contents

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

class xdk.spaces.SpacesClient

Client for spaces operations

Parameters

path.client
Client

__init__

Parameters

path.client
Client

get_buyers

Get Space ticket buyers Retrieves a list of Users who purchased tickets to a specific Space by its ID.

Parameters

path.id
str
The ID of the Space to be retrieved.
path.pagination_token
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
path.max_results
int or None
default:"None"
The maximum number 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

GetBuyersResponse - Response data

get_by_creator_ids

Get Spaces by creator IDs Retrieves details of Spaces created by specified User IDs.

Parameters

path.user_ids
List
The IDs of Users to search through.
path.space_fields
List or None
default:"None"
A comma separated list of Space 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.
path.topic_fields
List or None
default:"None"
A comma separated list of Topic fields to display.

Returns

GetByCreatorIdsResponse - Response data

get_by_id

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

Parameters

path.id
str
The ID of the Space to be retrieved.
path.space_fields
List or None
default:"None"
A comma separated list of Space 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.
path.topic_fields
List or None
default:"None"
A comma separated list of Topic fields to display.

Returns

GetByIdResponse - Response data

get_by_ids

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

Parameters

path.ids
List
The list of Space IDs to return.
path.space_fields
List or None
default:"None"
A comma separated list of Space 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.
path.topic_fields
List or None
default:"None"
A comma separated list of Topic fields to display.

Returns

GetByIdsResponse - Response data

get_posts

Get Space Posts Retrieves a list of Posts shared in a specific Space by its ID.

Parameters

path.id
str
The ID of the Space to be retrieved.
path.max_results
int or None
default:"None"
The number of Posts to fetch from the provided space. If not provided, the value will default to the maximum of 100.
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 Search Spaces Retrieves a list of Spaces matching the specified search query.

Parameters

path.query
str
The search query.
path.state
str or None
default:"None"
The state of Spaces to search for.
path.max_results
int or None
default:"None"
The number of results to return.
path.space_fields
List or None
default:"None"
A comma separated list of Space 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.
path.topic_fields
List or None
default:"None"
A comma separated list of Topic fields to display.

Returns

SearchResponse - Response data