> ## 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.

# Spaces 検索

> Spaces Search エンドポイントを使用すると、キーワードで開催中または予定されている Spaces を検索できます。X API v2 standard tier の検索に関するリファレンスです。

export const Button = ({href, children}) => {
  return <div className="not-prose">
    <a href={href}>
      <button className="x-btn">
        <span>{children}</span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

Spaces Search エンドポイントを使用すると、キーワードで開催中または予定されている Spaces を検索できます。関心のあるトピックの Spaces を見つけましょう。

## 概要

<CardGroup cols={2}>
  <Card title="キーワード検索" icon="https://mintcdn.com/x-preview-mintlify-5e62557c/GytiLHUg9NqWoUD-/icons/xds/icon-search.svg?fit=max&auto=format&n=GytiLHUg9NqWoUD-&q=85&s=99f4fce14d7ef13d21178fc37cb09631" width="24" height="24" data-path="icons/xds/icon-search.svg">
    タイトルで Spaces を検索
  </Card>

  <Card title="Spaces を発見" icon="https://mintcdn.com/x-preview-mintlify-5e62557c/dxXIRy5tzOESXfjK/icons/xds/icon-microphone.svg?fit=max&auto=format&n=dxXIRy5tzOESXfjK&q=85&s=ef1def23493faca9afc7659d9612d446" width="24" height="24" data-path="icons/xds/icon-microphone.svg">
    開催中や今後の Spaces を見つける
  </Card>
</CardGroup>

***

## エンドポイント

| Method | Endpoint                                          | 説明         |
| :----- | :------------------------------------------------ | :--------- |
| GET    | [`/2/spaces/search`](/x-api/spaces/search-spaces) | Spaces を検索 |

***

## パラメーター

| Parameter      | 説明                              |
| :------------- | :------------------------------ |
| `query`        | 検索クエリ(必須)                       |
| `state`        | `live` または `scheduled` でフィルタリング |
| `space.fields` | 追加の Space フィールド                 |
| `expansions`   | 含める関連オブジェクト                     |

***

## リクエスト例

```bash theme={null}
curl "https://api.x.com/2/spaces/search?\
query=AI&\
state=live&\
space.fields=title,host_ids,participant_count" \
  -H "Authorization: Bearer $BEARER_TOKEN"
```

## レスポンス例

```json title="レスポンス例" lines wrap icon="https://mintcdn.com/x-preview-mintlify-5e62557c/QVCcrJRuVU5c6Fli/icons/xds/icon-brackets.svg?fit=max&auto=format&n=QVCcrJRuVU5c6Fli&q=85&s=8c7124cd379f973762b135033c4e3df8" theme={null}
{
  "data": [
    {
      "id": "1DXxyRYNejbKM",
      "state": "live",
      "title": "Discussing AI and the Future",
      "host_ids": ["1234567890"],
      "participant_count": 245
    }
  ],
  "meta": {
    "result_count": 1
  }
}
```

***

## はじめに

<Note>
  **前提条件**

  * 承認済みの[開発者アカウント](https://developer.x.com/en/portal/petition/essential/basic-info)
  * Developer Console の[プロジェクトとアプリ](/resources/fundamentals/developer-apps)
  * アプリの[キーとトークン](/resources/fundamentals/authentication)
</Note>

<CardGroup cols={2}>
  <Card title="クイックスタート" icon="https://mintcdn.com/x-preview-mintlify-5e62557c/7ox7QZkMlDBhUtvj/icons/xds/icon-rocket.svg?fit=max&auto=format&n=7ox7QZkMlDBhUtvj&q=85&s=b6c3ee24b3b5aff4ba4a87805d56fdc9" href="/x-api/spaces/search/quickstart" width="24" height="24" data-path="icons/xds/icon-rocket.svg">
    最初の Space を検索
  </Card>

  <Card title="Spaces ルックアップ" icon="https://mintcdn.com/x-preview-mintlify-5e62557c/dxXIRy5tzOESXfjK/icons/xds/icon-microphone.svg?fit=max&auto=format&n=dxXIRy5tzOESXfjK&q=85&s=ef1def23493faca9afc7659d9612d446" href="/x-api/spaces/lookup/introduction" width="24" height="24" data-path="icons/xds/icon-microphone.svg">
    ID で Spaces をルックアップ
  </Card>

  <Card title="API リファレンス" icon="https://mintcdn.com/x-preview-mintlify-5e62557c/NnGYBQFO1PDkJQK7/icons/xds/icon-code.svg?fit=max&auto=format&n=NnGYBQFO1PDkJQK7&q=85&s=e6a5208c5ad4cc59a4a97fed7db5ed00" href="/x-api/spaces/search-spaces" width="24" height="24" data-path="icons/xds/icon-code.svg">
    完全なエンドポイントドキュメント
  </Card>
</CardGroup>
