> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SpacesClient

> X API TypeScript SDK の SpacesClient クラスのリファレンス。 X API v2 の spaces エンドポイントのメソッド、パラメーター、戻り値の型。

spaces 操作向けのクライアント

このクライアントは X API の spaces エンドポイントと対話するためのメソッドを提供します。認証、リクエストの整形、spaces に関連するすべての操作のレスポンス解析を扱います。

## コンストラクター

### コンストラクター

• **new SpacesClient**(`client`): [`SpacesClient`](/xdks/typescript/reference/classes/SpacesClient)

新しい spaces クライアントインスタンスを作成します

#### パラメーター

| 名前       | 型                                                     | 説明                      |
| :------- | :---------------------------------------------------- | :---------------------- |
| `client` | [`Client`](/xdks/typescript/reference/classes/Client) | メインの X API クライアントインスタンス |

#### 戻り値

[`SpacesClient`](/xdks/typescript/reference/classes/SpacesClient)

#### 定義場所

[spaces/client.ts:316](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L316)

## メソッド

### getByIds

▸ **getByIds**(`ids`, `options`): `Promise`\<`Response`>

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

#### パラメーター

| 名前        | 型                                                               | 説明                               |
| :-------- | :-------------------------------------------------------------- | :------------------------------- |
| `ids`     | `any`\[]                                                        | The list of Space IDs to return. |
| `options` | `GetByIdsOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                                |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[spaces/client.ts:361](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L361)

▸ **getByIds**(`ids`, `options?`): `Promise`\<[`Get2SpacesResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesResponse)>

#### パラメーター

| 名前         | 型                 |
| :--------- | :---------------- |
| `ids`      | `any`\[]          |
| `options?` | `GetByIdsOptions` |

#### 戻り値

`Promise`\<[`Get2SpacesResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesResponse)>

#### 定義場所

[spaces/client.ts:374](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L374)

***

### getPosts

▸ **getPosts**(`id`, `options`): `Promise`\<`Response`>

Get Space Posts
次の一覧を取得します: Posts shared in a specific Space by its ID.

#### パラメーター

| 名前        | 型                                                               | 説明                                   |
| :-------- | :-------------------------------------------------------------- | :----------------------------------- |
| `id`      | `string`                                                        | The ID of the Space to be retrieved. |
| `options` | `GetPostsOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                                    |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[spaces/client.ts:572](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L572)

▸ **getPosts**(`id`, `options?`): `Promise`\<[`Get2SpacesIdTweetsResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesIdTweetsResponse)>

#### パラメーター

| 名前         | 型                 |
| :--------- | :---------------- |
| `id`       | `string`          |
| `options?` | `GetPostsOptions` |

#### 戻り値

`Promise`\<[`Get2SpacesIdTweetsResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesIdTweetsResponse)>

#### 定義場所

[spaces/client.ts:585](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L585)

***

### search

▸ **search**(`query`, `options`): `Promise`\<`Response`>

Search Spaces
次の一覧を取得します: Spaces matching the specified search query.

#### パラメーター

| 名前        | 型                                                             | 説明                |
| :-------- | :------------------------------------------------------------ | :---------------- |
| `query`   | `string`                                                      | The search query. |
| `options` | `SearchOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                 |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[spaces/client.ts:835](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L835)

▸ **search**(`query`, `options?`): `Promise`\<[`Get2SpacesSearchResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesSearchResponse)>

#### パラメーター

| 名前         | 型               |
| :--------- | :-------------- |
| `query`    | `string`        |
| `options?` | `SearchOptions` |

#### 戻り値

`Promise`\<[`Get2SpacesSearchResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesSearchResponse)>

#### 定義場所

[spaces/client.ts:848](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L848)

***

### getBuyers

▸ **getBuyers**(`id`, `options`): `Promise`\<`Response`>

Get Space ticket buyers
次の一覧を取得します: Users who purchased tickets to a specific Space by its ID.

#### パラメーター

| 名前        | 型                                                                | 説明                                   |
| :-------- | :--------------------------------------------------------------- | :----------------------------------- |
| `id`      | `string`                                                         | The ID of the Space to be retrieved. |
| `options` | `GetBuyersOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                                    |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[spaces/client.ts:1080](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L1080)

▸ **getBuyers**(`id`, `options?`): `Promise`\<[`Get2SpacesIdBuyersResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesIdBuyersResponse)>

#### パラメーター

| 名前         | 型                  |
| :--------- | :----------------- |
| `id`       | `string`           |
| `options?` | `GetBuyersOptions` |

#### 戻り値

`Promise`\<[`Get2SpacesIdBuyersResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesIdBuyersResponse)>

#### 定義場所

[spaces/client.ts:1093](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L1093)

***

### getById

▸ **getById**(`id`, `options`): `Promise`\<`Response`>

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

#### パラメーター

| 名前        | 型                                                              | 説明                                   |
| :-------- | :------------------------------------------------------------- | :----------------------------------- |
| `id`      | `string`                                                       | The ID of the Space to be retrieved. |
| `options` | `GetByIdOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                                    |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[spaces/client.ts:1293](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L1293)

▸ **getById**(`id`, `options?`): `Promise`\<[`Get2SpacesIdResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesIdResponse)>

#### パラメーター

| 名前         | 型                |
| :--------- | :--------------- |
| `id`       | `string`         |
| `options?` | `GetByIdOptions` |

#### 戻り値

`Promise`\<[`Get2SpacesIdResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesIdResponse)>

#### 定義場所

[spaces/client.ts:1306](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L1306)

***

### getByCreatorIds

▸ **getByCreatorIds**(`userIds`, `options`): `Promise`\<`Response`>

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

#### パラメーター

| 名前        | 型                                                                      | 説明                                  |
| :-------- | :--------------------------------------------------------------------- | :---------------------------------- |
| `userIds` | `any`\[]                                                               | The IDs of Users to search through. |
| `options` | `GetByCreatorIdsOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                                   |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[spaces/client.ts:1495](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L1495)

▸ **getByCreatorIds**(`userIds`, `options?`): `Promise`\<[`Get2SpacesByCreatorIdsResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesByCreatorIdsResponse)>

#### パラメーター

| 名前         | 型                        |
| :--------- | :----------------------- |
| `userIds`  | `any`\[]                 |
| `options?` | `GetByCreatorIdsOptions` |

#### 戻り値

`Promise`\<[`Get2SpacesByCreatorIdsResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2SpacesByCreatorIdsResponse)>

#### 定義場所

[spaces/client.ts:1508](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/spaces/client.ts#L1508)
