> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-mintlify-7cae4884.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 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>;
};

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="microphone">
    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="user">
    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="rocket" href="/x-api/spaces/lookup/quickstart">
    Make your first Spaces lookup request
  </Card>

  <Card title="Search Spaces" icon="magnifying-glass" href="/x-api/spaces/search/introduction">
    Find Spaces by keyword
  </Card>

  <Card title="API Reference" icon="code" href="/x-api/spaces/space-lookup-by-space-id">
    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>
