Docs
Spaces & Audio

Spaces & Audio

Access Twitter Spaces data including live and recorded audio rooms.

Overview

The Spaces endpoints provide access to Twitter Spaces, including live rooms, recordings, participant lists, and host information.

Endpoints

Get Space by ID

Retrieves details about a Twitter Space.

GET /space/{space_id}

Parameters

NameTypeRequiredDescription
space_idstringYesThe unique Space ID

Headers

X-API-KEY: <YOUR_API_KEY>

Response Example

{
  "id": "1abcdefghijklmno",
  "state": "live",
  "title": "Tech Talk: The Future of AI",
  "created_at": "2024-10-01T12:00:00.000Z",
  "started_at": "2024-10-01T12:05:00.000Z",
  "scheduled_start": "2024-10-01T12:00:00.000Z",
  "ended_at": null,
  "updated_at": "2024-10-01T12:30:00.000Z",
  "host_ids": ["987654321"],
  "speaker_ids": ["111222333", "444555666"],
  "participant_count": 523,
  "total_replay_watched": 0,
  "is_ticketed": false,
  "creator": {
    "id": "987654321",
    "username": "tech_host",
    "name": "Tech Host",
    "profile_image_url": "https://..."
  },
  "topics": [
    {
      "id": "848920371311001600",
      "name": "Technology",
      "description": "All things tech"
    }
  ]
}

Search Spaces

Searches for live or scheduled Spaces.

GET /spaces/search

Parameters

NameTypeRequiredDescription
qstringYesSearch term
statestringNolive, scheduled, ended (Default: live)
limitintegerNoNumber of results (Default: 20, Max: 100)

Response Example

{
  "data": [
    {
      "id": "1abcdefghijklmno",
      "state": "live",
      "title": "Tech Talk: The Future of AI",
      "participant_count": 523,
      "creator": {
        "username": "tech_host",
        "name": "Tech Host"
      },
      "started_at": "2024-10-01T12:05:00.000Z"
    }
  ],
  "meta": {
    "result_count": 15
  }
}

Get Space Participants

Retrieves the participant list of a Space.

GET /space/{space_id}/participants

Parameters

NameTypeRequiredDescription
space_idstringYesThe Space ID
limitintegerNoNumber of results (Default: 100, Max: 1000)
rolestringNoFilter: host, speaker, listener

Response Example

{
  "hosts": [
    {
      "id": "987654321",
      "username": "tech_host",
      "name": "Tech Host",
      "profile_image_url": "https://...",
      "verified": true
    }
  ],
  "speakers": [
    {
      "id": "111222333",
      "username": "guest_speaker",
      "name": "Guest Speaker",
      "invited_at": "2024-10-01T12:00:00.000Z"
    }
  ],
  "listeners": [
    {
      "id": "444555666",
      "username": "listener_1",
      "joined_at": "2024-10-01T12:10:00.000Z"
    }
  ],
  "meta": {
    "total_participants": 523,
    "host_count": 1,
    "speaker_count": 3,
    "listener_count": 519
  }
}

Get User Spaces

Retrieves all Spaces for a user (hosted or participated in).

GET /user/{user_id}/spaces

Parameters

NameTypeRequiredDescription
user_idstringYesThe user ID
statestringNolive, scheduled, ended
rolestringNohost, speaker, participant
limitintegerNoNumber of results (Default: 20, Max: 100)

Response Example

{
  "data": [
    {
      "id": "1abcdefghijklmno",
      "state": "live",
      "title": "My Space",
      "participant_count": 523,
      "user_role": "host",
      "started_at": "2024-10-01T12:05:00.000Z"
    }
  ],
  "meta": {
    "result_count": 5
  }
}

Get Space Tweets

Retrieves tweets that mention or share a Space.

GET /space/{space_id}/tweets

Parameters

NameTypeRequiredDescription
space_idstringYesThe Space ID
limitintegerNoNumber of results (Default: 20, Max: 100)

Response Example

{
  "data": [
    {
      "id": "1234567890123456789",
      "text": "Join me in this amazing space! 🎙️",
      "author": {...},
      "created_at": "2024-10-01T12:00:00.000Z",
      "space_share": {
        "space_id": "1abcdefghijklmno",
        "title": "Tech Talk: The Future of AI"
      }
    }
  ]
}

Get Scheduled Spaces

Retrieves all scheduled Spaces.

GET /spaces/scheduled

Parameters

NameTypeRequiredDescription
fromstringNoStart date (ISO 8601)
tostringNoEnd date (ISO 8601)
topicstringNoTopic/Category
limitintegerNoNumber of results (Default: 20, Max: 100)

Response Example

{
  "data": [
    {
      "id": "1abcdefghijklmno",
      "state": "scheduled",
      "title": "Weekly Tech Roundup",
      "scheduled_start": "2024-10-02T15:00:00.000Z",
      "creator": {
        "username": "tech_host",
        "name": "Tech Host"
      },
      "topics": ["Technology"],
      "is_ticketed": false,
      "reminder_count": 156
    }
  ],
  "meta": {
    "result_count": 12
  }
}

Get Live Spaces

Retrieves all currently live Spaces.

GET /spaces/live

Parameters

NameTypeRequiredDescription
topicstringNoFilter by topic
min_participantsintegerNoMinimum participant count
verified_hosts_onlybooleanNoOnly verified hosts
limitintegerNoNumber of results (Default: 20, Max: 100)

Response Example

{
  "data": [
    {
      "id": "1abcdefghijklmno",
      "state": "live",
      "title": "Breaking News Discussion",
      "participant_count": 1523,
      "creator": {
        "username": "news_host",
        "verified": true
      },
      "started_at": "2024-10-01T11:00:00.000Z",
      "duration_minutes": 95
    }
  ],
  "meta": {
    "result_count": 45,
    "total_live_spaces": 523
  }
}

Get Space Recording

Retrieves recording information for an ended Space.

GET /space/{space_id}/recording

Response Example

{
  "space_id": "1abcdefghijklmno",
  "state": "ended",
  "recording_available": true,
  "recording": {
    "media_key": "13_1234567890123456789",
    "duration_ms": 5400000,
    "playback_url": "https://...",
    "download_url": "https://...",
    "file_size_mb": 125.4
  },
  "total_replay_watched": 2340,
  "ended_at": "2024-10-01T13:30:00.000Z"
}

Space States

StateDescription
scheduledSpace is scheduled but not yet started
liveSpace is currently running
endedSpace has ended
cancelledSpace was cancelled

Space Topics/Categories

Common topic IDs:

TopicID
Technology848920371311001600
Gaming849075377108226048
Music849075383444766721
Sports849075379953328129
News849075415688937472

Rate Limits

  • Basic Plan: 50 Requests/hour
  • Pro Plan: 500 Requests/hour
  • Enterprise Plan: 5,000 Requests/hour

Error Codes

CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Missing or invalid API Key
404Not Found - Space does not exist
403Forbidden - Access to private Space denied
429Too Many Requests - Rate limit exceeded
500Internal Server Error