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

# Spaces ルックアップ

> Spaces ルックアップエンドポイントを使用すると、開催中または予定されている 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 ルックアップエンドポイントを使用すると、開催中または予定されている Spaces の情報を取得できます。ID で Spaces をルックアップしたり、特定のユーザーが作成した Spaces を見つけたりできます。

## 概要

<CardGroup cols={2}>
  <Card title="ID で" icon="https://mintcdn.com/x-preview/SxzTbJaLjs3MidH1/icons/xds/icon-microphone.svg?fit=max&auto=format&n=SxzTbJaLjs3MidH1&q=85&s=84616ff8f3d942047a71ee5e0a5adab9" width="24" height="24" data-path="icons/xds/icon-microphone.svg">
    特定の Space の詳細を取得
  </Card>

  <Card title="複数の Spaces" icon="microphone-lines">
    一度に複数の Spaces をルックアップ
  </Card>

  <Card title="作成者で" icon="https://mintcdn.com/x-preview/SxzTbJaLjs3MidH1/icons/xds/icon-person.svg?fit=max&auto=format&n=SxzTbJaLjs3MidH1&q=85&s=507a4bbcdcf5744bd18781508002e305" width="24" height="24" data-path="icons/xds/icon-person.svg">
    ホスト別に Spaces を検索
  </Card>

  <Card title="購入者" icon="ticket">
    チケットを購入したユーザーを取得
  </Card>
</CardGroup>

***

## エンドポイント

| Method | Endpoint                                                              | 説明                      |
| :----- | :-------------------------------------------------------------------- | :---------------------- |
| GET    | [`/2/spaces/:id`](/x-api/spaces/get-space-by-id)                      | ID で Space を取得          |
| GET    | [`/2/spaces`](/x-api/spaces/get-spaces-by-ids)                        | 複数の ID で Spaces を取得     |
| GET    | [`/2/spaces/by/creator_ids`](/x-api/spaces/get-spaces-by-creator-ids) | 作成者ユーザー ID で Spaces を取得 |
| GET    | [`/2/spaces/:id/buyers`](/x-api/spaces/get-space-ticket-buyers)       | Space のチケット購入者を取得       |
| GET    | [`/2/spaces/:id/tweets`](/x-api/spaces/get-space-posts)               | Space で共有された Post を取得   |

***

## レスポンスフィールド

デフォルトでは、レスポンスに `id` と `state` が含まれます。追加フィールドをリクエストする方法:

| Field               | 説明                 |
| :------------------ | :----------------- |
| `title`             | Space のタイトル        |
| `host_ids`          | ホストのユーザー ID        |
| `speaker_ids`       | スピーカーのユーザー ID      |
| `participant_count` | 参加者数               |
| `scheduled_start`   | 予定開始時刻             |
| `started_at`        | 実際の開始時刻            |
| `ended_at`          | 終了時刻               |
| `is_ticketed`       | Space にチケットがあるかどうか |

### Space の状態

| State       | 説明      |
| :---------- | :------ |
| `live`      | 現在アクティブ |
| `scheduled` | 将来に予定   |
| `ended`     | 終了済み    |

***

## リクエスト例

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

***

## はじめに

<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/oR-aRNyj1BKPJtxM/icons/xds/icon-rocket.svg?fit=max&auto=format&n=oR-aRNyj1BKPJtxM&q=85&s=b978d7a9225de31709efbbed5b84e92d" href="/x-api/spaces/lookup/quickstart" width="24" height="24" data-path="icons/xds/icon-rocket.svg">
    最初の Spaces ルックアップリクエストを実行
  </Card>

  <Card title="Spaces を検索" icon="https://mintcdn.com/x-preview/cfyQtgCdwk8p69aa/icons/xds/icon-search.svg?fit=max&auto=format&n=cfyQtgCdwk8p69aa&q=85&s=8c11ad89387b7c09ced1553d5c232834" href="/x-api/spaces/search/introduction" width="24" height="24" data-path="icons/xds/icon-search.svg">
    キーワードで Spaces を検索
  </Card>

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

  <Card title="サンプルコード" icon="github" href="https://github.com/xdevplatform/Twitter-API-v2-sample-code">
    動作するコード例
  </Card>
</CardGroup>
