client.spaces (SpacesClient).
Methods
| Method | Endpoint | Behavior | Summary |
|---|---|---|---|
get_buyers | GET /2/spaces/{id}/buyers | Paginated | Get Space Ticket Buyers |
get_by_creator_ids | GET /2/spaces/by/creator_ids | Standard | Get Spaces by Creator IDs |
get_by_id | GET /2/spaces/{id} | Standard | Get Space by ID |
get_by_ids | GET /2/spaces | Standard | Get Spaces by IDs |
get_posts | GET /2/spaces/{id}/tweets | Paginated | Get Space Posts |
search | GET /2/spaces/search | Standard | Search Spaces |
get_buyers
GET /2/spaces/{id}/buyers Paginated
Get Space Ticket Buyers
Retrieves a list of Users who purchased tickets to a specific Space by its ID.
import os
from xdk import Client
client = Client(access_token=os.environ["X_ACCESS_TOKEN"])
for page in client.spaces.get_buyers(id="1YqKDqWLPPlGV"):
print(page.data)
Parameters
Show Optional keyword arguments (5)
Show Optional keyword arguments (5)
List[Literal["active_follower_count", "confirmed_email", "connection_status", "created_at", "description", "entities", "id", "is_identity_verified", "location", "name", "org_only", "parody", "profile_banner_url", "profile_image_url", "protected", "public_metrics", "receives_your_chat", "receives_your_dm", "subscriber_count", "subscribes_to_you", "subscription", "subscription_type", "url", "username", "verified", "verified_followers_count", "verified_type", "withheld"]]
A comma separated list of User fields to display.
A comma separated list of fields to expand.
List[Literal["article", "article_title", "attachments", "card_uri", "community_id", "context_annotations", "conversation_id", "created_at", "display_text_range", "edit_controls", "entities", "geo", "id", "lang", "matched_media_notes", "media_metadata", "non_public_metrics", "note_post", "note_request_suggestions", "organic_metrics", "paid_partnership", "possibly_sensitive", "promoted_metrics", "public_metrics", "reply_settings", "scopes", "source", "suggested_source_links", "suggested_source_links_with_counts", "text", "withheld"]]
A comma separated list of Post fields to display.
Iterator[GetBuyersResponse]
get_by_creator_ids
GET /2/spaces/by/creator_ids
Get Spaces by Creator IDs
Retrieves details of Spaces created by specified User IDs.
import os
from xdk import Client
client = Client(bearer_token=os.environ["X_BEARER_TOKEN"])
response = client.spaces.get_by_creator_ids(user_ids=["2244994945"])
print(response)
Parameters
Show Optional keyword arguments (4)
Show Optional keyword arguments (4)
List[Literal["created_at", "ended_at", "id", "is_ticketed", "lang", "participant_count", "scheduled_start", "started_at", "state", "subscriber_count", "title", "updated_at"]]
A comma separated list of Space fields to display.
A comma separated list of fields to expand.
List[Literal["active_follower_count", "confirmed_email", "connection_status", "created_at", "description", "entities", "id", "is_identity_verified", "location", "name", "org_only", "parody", "profile_banner_url", "profile_image_url", "protected", "public_metrics", "receives_your_chat", "receives_your_dm", "subscriber_count", "subscribes_to_you", "subscription", "subscription_type", "url", "username", "verified", "verified_followers_count", "verified_type", "withheld"]]
A comma separated list of User fields to display.
GetByCreatorIdsResponse
get_by_id
GET /2/spaces/{id}
Get Space by ID
Retrieves details of a specific Space by its ID.
import os
from xdk import Client
client = Client(bearer_token=os.environ["X_BEARER_TOKEN"])
response = client.spaces.get_by_id(id="1YqKDqWLPPlGV")
print(response)
Parameters
Show Optional keyword arguments (4)
Show Optional keyword arguments (4)
List[Literal["created_at", "ended_at", "id", "is_ticketed", "lang", "participant_count", "scheduled_start", "started_at", "state", "subscriber_count", "title", "updated_at"]]
A comma separated list of Space fields to display.
A comma separated list of fields to expand.
List[Literal["active_follower_count", "confirmed_email", "connection_status", "created_at", "description", "entities", "id", "is_identity_verified", "location", "name", "org_only", "parody", "profile_banner_url", "profile_image_url", "protected", "public_metrics", "receives_your_chat", "receives_your_dm", "subscriber_count", "subscribes_to_you", "subscription", "subscription_type", "url", "username", "verified", "verified_followers_count", "verified_type", "withheld"]]
A comma separated list of User fields to display.
GetByIdResponse
get_by_ids
GET /2/spaces
Get Spaces by IDs
Retrieves details of multiple Spaces by their IDs.
import os
from xdk import Client
client = Client(bearer_token=os.environ["X_BEARER_TOKEN"])
response = client.spaces.get_by_ids(ids=["1YqKDqWLPPlGV"])
print(response)
Parameters
Show Optional keyword arguments (4)
Show Optional keyword arguments (4)
List[Literal["created_at", "ended_at", "id", "is_ticketed", "lang", "participant_count", "scheduled_start", "started_at", "state", "subscriber_count", "title", "updated_at"]]
A comma separated list of Space fields to display.
A comma separated list of fields to expand.
List[Literal["active_follower_count", "confirmed_email", "connection_status", "created_at", "description", "entities", "id", "is_identity_verified", "location", "name", "org_only", "parody", "profile_banner_url", "profile_image_url", "protected", "public_metrics", "receives_your_chat", "receives_your_dm", "subscriber_count", "subscribes_to_you", "subscription", "subscription_type", "url", "username", "verified", "verified_followers_count", "verified_type", "withheld"]]
A comma separated list of User fields to display.
GetByIdsResponse
get_posts
GET /2/spaces/{id}/tweets Paginated
Get Space Posts
Retrieves a list of Posts shared in a specific Space by its ID.
import os
from xdk import Client
client = Client(bearer_token=os.environ["X_BEARER_TOKEN"])
for page in client.spaces.get_posts(id="1YqKDqWLPPlGV"):
print(page.data)
Parameters
Show Optional keyword arguments (8)
Show Optional keyword arguments (8)
List[Literal["article", "article_title", "attachments", "card_uri", "community_id", "context_annotations", "conversation_id", "created_at", "display_text_range", "edit_controls", "entities", "geo", "id", "lang", "matched_media_notes", "media_metadata", "non_public_metrics", "note_post", "note_request_suggestions", "organic_metrics", "paid_partnership", "possibly_sensitive", "promoted_metrics", "public_metrics", "reply_settings", "scopes", "source", "suggested_source_links", "suggested_source_links_with_counts", "text", "withheld"]]
A comma separated list of Post fields to display.
List[Literal["article.cover_media", "article.media_entities", "attachments.media_keys", "attachments.media_source_tweet", "attachments.poll_ids", "author_id", "edit_history_post_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_posts", "username"]]
A comma separated list of fields to expand.
List[Literal["active_follower_count", "confirmed_email", "connection_status", "created_at", "description", "entities", "id", "is_identity_verified", "location", "name", "org_only", "parody", "profile_banner_url", "profile_image_url", "protected", "public_metrics", "receives_your_chat", "receives_your_dm", "subscriber_count", "subscribes_to_you", "subscription", "subscription_type", "url", "username", "verified", "verified_followers_count", "verified_type", "withheld"]]
A comma separated list of User fields to display.
List[Literal["alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "revenue", "type", "url", "variants", "width"]]
A comma separated list of Media fields to display.
A comma separated list of Poll fields to display.
Iterator[GetPostsResponse]
search
GET /2/spaces/search
Search Spaces
Retrieves a list of Spaces matching the specified search query.
import os
from xdk import Client
client = Client(bearer_token=os.environ["X_BEARER_TOKEN"])
response = client.spaces.search(query="from:XDevelopers")
print(response)
Parameters
Show Optional keyword arguments (6)
Show Optional keyword arguments (6)
List[Literal["created_at", "ended_at", "id", "is_ticketed", "lang", "participant_count", "scheduled_start", "started_at", "state", "subscriber_count", "title", "updated_at"]]
A comma separated list of Space fields to display.
A comma separated list of fields to expand.
List[Literal["active_follower_count", "confirmed_email", "connection_status", "created_at", "description", "entities", "id", "is_identity_verified", "location", "name", "org_only", "parody", "profile_banner_url", "profile_image_url", "protected", "public_metrics", "receives_your_chat", "receives_your_dm", "subscriber_count", "subscribes_to_you", "subscription", "subscription_type", "url", "username", "verified", "verified_followers_count", "verified_type", "withheld"]]
A comma separated list of User fields to display.
SearchResponse