> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-mintlify-5e62557c.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SpacesClient

> Reference for the spaces Python package in the X API SDK, grouping the client and Pydantic models for the spaces endpoints of the X API v2.

## 하위 모듈

* [xdk.spaces.client module](/xdks/python/reference/xdk.spaces.client)
  * [`SpacesClient`](/xdks/python/reference/xdk.spaces.client#xdk.spaces.client.SpacesClient)
    * [`SpacesClient.__init__()`](/xdks/python/reference/xdk.spaces.client#xdk.spaces.client.SpacesClient.__init__)
    * [`SpacesClient.get_buyers()`](/xdks/python/reference/xdk.spaces.client#xdk.spaces.client.SpacesClient.get_buyers)
    * [`SpacesClient.get_by_creator_ids()`](/xdks/python/reference/xdk.spaces.client#xdk.spaces.client.SpacesClient.get_by_creator_ids)
    * [`SpacesClient.get_by_id()`](/xdks/python/reference/xdk.spaces.client#xdk.spaces.client.SpacesClient.get_by_id)
    * [`SpacesClient.get_by_ids()`](/xdks/python/reference/xdk.spaces.client#xdk.spaces.client.SpacesClient.get_by_ids)
    * [`SpacesClient.get_posts()`](/xdks/python/reference/xdk.spaces.client#xdk.spaces.client.SpacesClient.get_posts)
    * [`SpacesClient.search()`](/xdks/python/reference/xdk.spaces.client#xdk.spaces.client.SpacesClient.search)
* [xdk.spaces.models module](/xdks/python/reference/xdk.spaces.models)
  * [`GetBuyersResponse`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.GetBuyersResponse)
    * [`GetBuyersResponse.model_config`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.GetBuyersResponse.model_config)
  * [`GetByCreatorIdsResponse`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.GetByCreatorIdsResponse)
    * [`GetByCreatorIdsResponse.model_config`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.GetByCreatorIdsResponse.model_config)
  * [`GetByIdResponse`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.GetByIdResponse)
    * [`GetByIdResponse.model_config`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.GetByIdResponse.model_config)
  * [`GetByIdsResponse`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.GetByIdsResponse)
    * [`GetByIdsResponse.model_config`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.GetByIdsResponse.model_config)
  * [`GetPostsResponse`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.GetPostsResponse)
    * [`GetPostsResponse.model_config`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.GetPostsResponse.model_config)
  * [`SearchResponse`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.SearchResponse)
    * [`SearchResponse.model_config`](/xdks/python/reference/xdk.spaces.models#xdk.spaces.models.SearchResponse.model_config)

## 모듈 내용

이 모듈은 X API의 spaces 엔드포인트에 대한 액세스를 제공합니다.
모든 spaces-related 기능의 주요 진입점 역할을 합니다.

### `class xdk.spaces.SpacesClient`

Spaces 작업을 위한 클라이언트

#### 매개변수

<ParamField path="path.client" type="Client" />

### `__init__`

#### 매개변수

<ParamField path="path.client" type="Client" />

### `get_buyers`

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

#### 매개변수

<ParamField path="path.id" type="str">
  The ID of the Space to be retrieved.
</ParamField>

<ParamField path="path.pagination_token" type="Any or None" default="None">
  This parameter is used to get a specified ‘page’ of results.
</ParamField>

<ParamField path="path.max_results" type="int or None" default="None">
  결과의 최대 개수입니다.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  표시할 User 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  확장할 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
</ParamField>

#### 반환값

`IteratorGetBuyersResponse`

### `get_by_creator_ids`

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

#### 매개변수

<ParamField path="path.user_ids" type="List">
  The IDs of Users to search through.
</ParamField>

<ParamField path="path.space_fields" type="List or None" default="None">
  표시할 Space 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  확장할 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  표시할 User 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.topic_fields" type="List or None" default="None">
  표시할 Topic 필드의 쉼표로 구분된 목록입니다.
</ParamField>

#### 반환값

`GetByCreatorIdsResponse` - 응답 데이터

### `get_by_id`

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

#### 매개변수

<ParamField path="path.id" type="str">
  The ID of the Space to be retrieved.
</ParamField>

<ParamField path="path.space_fields" type="List or None" default="None">
  표시할 Space 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  확장할 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  표시할 User 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.topic_fields" type="List or None" default="None">
  표시할 Topic 필드의 쉼표로 구분된 목록입니다.
</ParamField>

#### 반환값

`GetByIdResponse` - 응답 데이터

### `get_by_ids`

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

#### 매개변수

<ParamField path="path.ids" type="List">
  The list of Space IDs to return.
</ParamField>

<ParamField path="path.space_fields" type="List or None" default="None">
  표시할 Space 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  확장할 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  표시할 User 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.topic_fields" type="List or None" default="None">
  표시할 Topic 필드의 쉼표로 구분된 목록입니다.
</ParamField>

#### 반환값

`GetByIdsResponse` - 응답 데이터

### `get_posts`

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

#### 매개변수

<ParamField path="path.id" type="str">
  The ID of the Space to be retrieved.
</ParamField>

<ParamField path="path.max_results" type="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.
</ParamField>

<ParamField path="path.tweet_fields" type="List or None" default="None">
  표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  확장할 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.media_fields" type="List or None" default="None">
  표시할 Media 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.poll_fields" type="List or None" default="None">
  표시할 Poll 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  표시할 User 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.place_fields" type="List or None" default="None">
  표시할 Place 필드의 쉼표로 구분된 목록입니다.
</ParamField>

#### 반환값

`GetPostsResponse` - 응답 데이터

### `search`

Search Spaces
Retrieves a list of Spaces matching the specified search query.

#### 매개변수

<ParamField path="path.query" type="str">
  The search query.
</ParamField>

<ParamField path="path.state" type="str or None" default="None">
  The state of Spaces to search for.
</ParamField>

<ParamField path="path.max_results" type="int or None" default="None">
  The number of results to return.
</ParamField>

<ParamField path="path.space_fields" type="List or None" default="None">
  표시할 Space 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.expansions" type="List or None" default="None">
  확장할 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.user_fields" type="List or None" default="None">
  표시할 User 필드의 쉼표로 구분된 목록입니다.
</ParamField>

<ParamField path="path.topic_fields" type="List or None" default="None">
  표시할 Topic 필드의 쉼표로 구분된 목록입니다.
</ParamField>

#### 반환값

`SearchResponse` - 응답 데이터
