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

# Spaces 検索

> キーワードでライブまたはスケジュール済みの Spaces を検索する

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <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 を見つけられます。

<div id="overview">
  ## 概要
</div>

<CardGroup cols={2}>
  <Card title="キーワード検索" icon="magnifying-glass">
    タイトルで Spaces を検索
  </Card>

  <Card title="Spaces を見つける" icon="microphone">
    ライブ中および今後の Spaces を見つける
  </Card>
</CardGroup>

***

<div id="endpoint">
  ## エンドポイント
</div>

| メソッド | エンドポイント                                              | 説明         |
| :--- | :--------------------------------------------------- | :--------- |
| GET  | [`/2/spaces/search`](/ja/x-api/spaces/search-spaces) | Spaces を検索 |

***

<div id="parameters">
  ## パラメーター
</div>

| パラメーター         | 説明                           |
| :------------- | :--------------------------- |
| `query`        | 検索クエリ (必須)                   |
| `state`        | `live` または `scheduled` で絞り込み |
| `space.fields` | 追加の Space フィールド              |
| `expansions`   | レスポンスに含める関連オブジェクト            |

***

<div id="example-request">
  ## リクエスト例
</div>

```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"
```

<div id="example-response">
  ## レスポンス例
</div>

```json theme={null}
{
  "data": [
    {
      "id": "1DXxyRYNejbKM",
      "state": "live",
      "title": "Discussing AI and the Future",
      "host_ids": ["1234567890"],
      "participant_count": 245
    }
  ],
  "meta": {
    "result_count": 1
  }
}
```

***

<div id="getting-started">
  ## はじめに
</div>

<Note>
  **前提条件**

  * 承認済みの[開発者アカウント](https://developer.x.com/en/portal/petition/essential/basic-info)
  * 開発者コンソールで作成した [Project と App](/ja/resources/fundamentals/developer-apps)
  * お使いの App の[キーとトークン](/ja/resources/fundamentals/authentication)
</Note>

<CardGroup cols={2}>
  <Card title="クイックスタート" icon="rocket" href="/ja/x-api/spaces/search/quickstart">
    最初のスペースを検索する
  </Card>

  <Card title="Spaces ルックアップ" icon="microphone" href="/ja/x-api/spaces/lookup/introduction">
    ID でスペースを取得する
  </Card>

  <Card title="APIリファレンス" icon="code" href="/ja/x-api/spaces/search-spaces">
    エンドポイントの完全なドキュメント
  </Card>
</CardGroup>
