Platforms/X (Twitter)/Space

X (Twitter) Spaces API

GET · 1 credit

Send a Space's id or link, and get its title, state, hosts and speakers, listeners, times and whether it can be replayed.

GET /v1/twitter/spaces

What people use it for

  • Live audio tracking: check a Space while it runs and record its listeners.
  • Event research: see who hosted and spoke in a Space, and when.

How it works with other endpoints

Each host's and speaker's handle goes to Profile.

Limits

  • One Space a call.
  • listeners is the count now: 0 once the Space has ended.

Example request

const url = `${process.env.API_URL}/v1/twitter/spaces?space_id=1YGNrbYyLROGw`;

const response = await fetch(url, {
  headers: { "x-api-key": process.env.API_KEY },
});

const { data } = await response.json();
console.log(data);

Parameters

ParameterRequiredDescription
space_idNoA Space's id: the part after /spaces/ in its link. Give space_id or url.
urlNoA Space's link: x.com/i/spaces/<id>. Give space_id or url.

Example response

{
  "data": {
    "id": "1YGNrbYyLROGw",
    "url": "https://x.com/i/spaces/1YGNrbYyLROGw",
    "title": "Ask an astronaut",
    "state": "Ended",
    "host_id": "11348282",
    "host_handle": "NASA",
    "host_name": "NASA",
    "hosts": [
      "NASA",
      "Space_Station"
    ],
    "speakers": [
      "NASA_Astronauts"
    ],
    "listeners": 0,
    "replay": true,
    "started_at": "2026-11-20T18:00:00Z",
    "ended_at": "2026-11-20T19:02:00Z"
  },
  "page": null,
  "meta": {
    "platform": "twitter",
    "endpoint": "space",
    "params": {
      "space_id": "1YGNrbYyLROGw"
    },
    "request_id": "sp_req_1f8c2d3e4a5b6c7d",
    "api_version": "v1",
    "fetched_at": "2026-11-30T09:30:00Z",
    "cached": false
  }
}

An illustrative answer: live answers have the same shape, with the page's current data.

Every field, with its type, is in the API reference, and every error code in Errors.

Price

Each call costs 1 credit, a not-found answer too. Cached answers and other errors cost nothing, and credits never expire. New accounts start with 100 free credits. See pricing for the packs.

FAQ

What does state mean?

Running while it's live, Ended once it's over, and NotStarted for a scheduled Space.

Why is listeners 0?

listeners is how many are listening now: 0 once the Space has ended.

Can I get the recording?

replay says whether the recording can be played on X; the API doesn't return the audio.

Works with

Start free

Your first 100 credits are on us

Sign up, create a key and make your first call in a few minutes.

No credit card required