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

# Spaces Lookup

> The Spaces lookup endpoints let you retrieve information about live or scheduled Spaces. Reference for the X API v2 standard tier covering lookup.

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>;
};

The Spaces lookup endpoints let you retrieve information about live or scheduled Spaces. Look up Spaces by their ID or find Spaces created by specific users.

## Overview

<CardGroup cols={2}>
  <Card title="By ID" icon="https://mintcdn.com/x-preview-mintlify-93ac23a1/xDkS3J2Wqmv3X-7s/icons/xds/icon-microphone.svg?fit=max&auto=format&n=xDkS3J2Wqmv3X-7s&q=85&s=edf65d5690efea389e033fb6630d7388" width="24" height="24" data-path="icons/xds/icon-microphone.svg">
    Get details for a specific Space
  </Card>

  <Card title="Multiple Spaces" icon="microphone-lines">
    Look up multiple Spaces at once
  </Card>

  <Card title="By creator" icon="https://mintcdn.com/x-preview-mintlify-93ac23a1/xDkS3J2Wqmv3X-7s/icons/xds/icon-person.svg?fit=max&auto=format&n=xDkS3J2Wqmv3X-7s&q=85&s=a837902589e9c75879891dbc090ff38a" width="24" height="24" data-path="icons/xds/icon-person.svg">
    Find Spaces by their hosts
  </Card>

  <Card title="Buyers" icon="ticket">
    Get users who purchased tickets
  </Card>
</CardGroup>

***

## Endpoints

| Method | Endpoint | Description |
| :- | :- | :- |
| GET | [`/2/spaces/:id`](/x-api/spaces/get-space-by-id) | Get Space by ID |
| GET | [`/2/spaces`](/x-api/spaces/get-spaces-by-ids) | Get Spaces by IDs |
| GET | [`/2/spaces/by/creator_ids`](/x-api/spaces/get-spaces-by-creator-ids) | Get Spaces by creator user IDs |
| GET | [`/2/spaces/:id/buyers`](/x-api/spaces/get-space-ticket-buyers) | Get ticket buyers for a Space |
| GET | [`/2/spaces/:id/tweets`](/x-api/spaces/get-space-posts) | Get Posts shared in a Space |

***

## Response fields

By default, the response includes `id` and `state`. Request additional fields:

| Field | Description |
| :- | :- |
| `title` | Space title |
| `host_ids` | Host user IDs |
| `speaker_ids` | Speaker user IDs |
| `participant_count` | Number of participants |
| `scheduled_start` | Scheduled start time |
| `started_at` | Actual start time |
| `ended_at` | End time |
| `is_ticketed` | Whether Space has tickets |

### Space states

| State | Description |
| :- | :- |
| `live` | Currently active |
| `scheduled` | Scheduled for future |
| `ended` | Has ended |

***

## Example request

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

***

## Getting started

<Note>
  **Prerequisites**

  * An approved [developer account](https://developer.x.com/en/portal/petition/essential/basic-info)
  * A [Project and App](/resources/fundamentals/developer-apps) in the Developer Console
  * Your App's [keys and tokens](/resources/fundamentals/authentication)
</Note>

<CardGroup cols={2}>
  <Card title="Quickstart" icon="https://mintcdn.com/x-preview-mintlify-93ac23a1/rTcxPRRNaNOl1Poz/icons/xds/icon-rocket.svg?fit=max&auto=format&n=rTcxPRRNaNOl1Poz&q=85&s=d97da689c93e0b8d38f919cec382d33c" href="/x-api/spaces/lookup/quickstart" width="24" height="24" data-path="icons/xds/icon-rocket.svg">
    Make your first Spaces lookup request
  </Card>

  <Card title="Search Spaces" icon="https://mintcdn.com/x-preview-mintlify-93ac23a1/DZEIGKeGK8EJVzCL/icons/xds/icon-search.svg?fit=max&auto=format&n=DZEIGKeGK8EJVzCL&q=85&s=7b6804e93b7055a7d35d731707a97d8e" href="/x-api/spaces/search/introduction" width="24" height="24" data-path="icons/xds/icon-search.svg">
    Find Spaces by keyword
  </Card>

  <Card title="API Reference" icon="https://mintcdn.com/x-preview-mintlify-93ac23a1/AO3BvOiXS-lYJQ8t/icons/xds/icon-code.svg?fit=max&auto=format&n=AO3BvOiXS-lYJQ8t&q=85&s=1f5bd3f2c9da04a9409be944c25de90f" href="/x-api/spaces/space-lookup-by-space-id" width="24" height="24" data-path="icons/xds/icon-code.svg">
    Full endpoint documentation
  </Card>

  <Card title="Sample code" icon="github" href="https://github.com/xdevplatform/Twitter-API-v2-sample-code">
    Working code examples
  </Card>
</CardGroup>
