Skip to main content
This guide walks you through retrieving Space information using the Spaces lookup endpoints.
PrerequisitesBefore you begin, you’ll need:

Get a Space by ID

Retrieve details for a specific Space:
cURL
curl "https://api.x.com/2/spaces/1DXxyRYNejbKM?\
space.fields=title,host_ids,participant_count,scheduled_start,state,created_at" \
  -H "Authorization: Bearer $BEARER_TOKEN"

Response

{
  "data": {
    "id": "1DXxyRYNejbKM",
    "state": "live",
    "title": "Discussing AI and the Future",
    "host_ids": ["2244994945"],
    "participant_count": 245,
    "created_at": "2024-01-15T09:00:00.000Z"
  }
}

Get multiple Spaces

Look up multiple Spaces at once:
cURL
curl "https://api.x.com/2/spaces?\
ids=1DXxyRYNejbKM,1YqJDqWYNQDGW&\
space.fields=title,state,participant_count" \
  -H "Authorization: Bearer $BEARER_TOKEN"

Get Spaces by creator

Find Spaces hosted by specific users:
cURL
curl "https://api.x.com/2/spaces/by/creator_ids?\
user_ids=2244994945,783214&\
space.fields=title,state,scheduled_start" \
  -H "Authorization: Bearer $BEARER_TOKEN"

Include host information

Expand host user data:
cURL
curl "https://api.x.com/2/spaces/1DXxyRYNejbKM?\
space.fields=title,host_ids,state&\
expansions=host_ids&\
user.fields=username,verified" \
  -H "Authorization: Bearer $BEARER_TOKEN"

Response with expansion

{
  "data": {
    "id": "1DXxyRYNejbKM",
    "state": "live",
    "title": "Discussing AI and the Future",
    "host_ids": ["2244994945"]
  },
  "includes": {
    "users": [
      {
        "id": "2244994945",
        "username": "XDevelopers",
        "verified": true
      }
    ]
  }
}

Space states

StateDescription
liveCurrently active
scheduledScheduled for future
endedHas ended

Available fields

FieldDescription
titleSpace title
host_idsHost user IDs
speaker_idsSpeaker user IDs
participant_countCurrent participants
scheduled_startScheduled start time
started_atActual start time
ended_atEnd time
is_ticketedWhether Space has tickets
stateCurrent state

Next steps