Introducing the Instagram APIRead more →

X (Twitter) Spaces API. Send a spaces link or ID.

Live audio room with host, listeners and replay. We handle the proxies, blocks and platform changes.

In your agent: X (Twitter) MCP server →

X (Twitter) Spaces API at a glance

Returns an X (formerly Twitter) Space from its link or ID: whether it is live, scheduled or over, its title, host, start and end, how many listen now and how many tuned in. It also has the co-hosts, speakers, the listeners X names, topics, replay plays, the post it was shared in, and on request the live or recorded audio's HLS playlist.

GET /v1/x/space

Read the API reference
  • 1 credit per request, $0.75–$1.97 per 1,000 requests
  • 17 typed fields null when unknown
  • url is all it needs, e.g. https://x.com/i/spaces/1MnxnMDeQLeJO
  • 100 credits free when you sign up, no card, so you can build before you spend

Send one request. Get 17 fields back.

Copy the request in your language, or hand it to your agent. Sign up for an API key and your first 100 credits are free.

$ npm install socialtap
url = https://x.com/i/spaces/1MnxnMDeQLeJO
GET /v1/x/spaceTry in
const params = new URLSearchParams({
  streams: "true",
  url: "https://x.com/i/spaces/1MnxnMDeQLeJO",
});
const res = await fetch(`https://socialtap.dev/v1/x/space?${params}`, {
  headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, meta } = body;
console.log(data, meta.credits_charged);
200 OK · GET https://socialtap.dev/v1/x/spaceLong arrays and strings are shortened here. Real responses are complete.Docs

One schema on 3 platforms.

The response reference lists every field, its type and when it is null. See the full schema.

  • Null means unknown

    A field X doesn't show is null, never zero or an empty string, so a real zero always means zero.

  • What it accepts

    The Space: its link on x.com or twitter.com (x.com/i/spaces/<id>, its /peek view, mobile hosts and any query too) or its ID.

  • Write one parser

    X, TikTok and Twitch answer in these fields, so the code that reads one reads them all.

platformstring
Platform ID (tiktok, youtube, …).
idstring
Platform-native ID of the broadcast (string; TikTok room ID, YouTube video ID).
urlstring
Public page of the broadcast (TikTok: the host's LIVE page, tiktok.com/@<username>/live).
statusstring
live: on air now; scheduled: announced, not started; ended: over. New values may be added; treat an unknown value as not live.
titlestring
The broadcast's title as the host set it.
textstring
Description as plain text; null where the platform has none.
categorystring
The topic or game the broadcast is filed under, as the platform names it.
hostobject
The broadcasting account.

What teams build with the X (Twitter) Spaces API.

  • Archive a Space's recording

  • Track who speaks in a community's Spaces

  • Monitor live listener counts

  • Alert when a scheduled Space starts

Good to know before you build.

  • streams and platform_specific.x.replay_url are filled only with streams=true. Without it, a live Space lists streams in unknown_fields.
  • metrics.concurrent_viewer_count counts the people listening now and is null unless the Space is live. metrics.view_count counts everyone who tuned in live, and platform_specific.x.metrics.replay_view_count the plays of its recording.
  • platform_specific.x.listeners holds the listeners X names, at most 50, while the Space is live, and is empty once it ends.
  • A Space that never existed and one its host deleted look the same on X, and both return not_found.
  • When X's Space API fails, the Space comes from X's newer query or its page, which lack the media key, playlist, listeners, topics and post: those are then null or listed in unknown_fields.

1 credit per request. Failed requests are free.

Buy credits once and spend them on any endpoint, on any platform.

SourcePrice per successful requestPer 1,000 requests
Any source1 credit$0.75–$1.97
  • Cache hits are free.
  • Credits from packs and top-ups never expire.
  • A monthly plan's credits are spent first, and what is left of them ends at each renewal.
  • Prices exclude tax: sales tax is added at checkout where it applies.
  • Outside the US, plans and packs are sold to businesses: checkout asks for your VAT, GST or other business tax ID.

Questions about the X (Twitter) Spaces API.

More in the API reference.

How much does the X (Twitter) Spaces API cost?
A request costs 1 credit. SocialTap credits cost $0.75–$1.97 per 1,000, depending on the plan or pack.

Try it on a link you already have.

Paste it in the playground, or copy the request into your code.

100free credits
  • No credit card
  • Failed requests are free
  • Works on all 276 endpoints
Start for free Read the docs