Skip to content

Spaces ​

Read, search and interact with Spaces. Live video and live chat are in Broadcasts.

Reading ​

spaces.get(spaceId, opts?) ​

Gets a Space. Pass includePeek: true for the peek data.

js
const space = await client.spaces.get("1evjeAyedmbNan");

spaces.details(spaceId) ​

Gets the details panel of a Space.

spaces.search(query, opts?) ​

Searches Spaces. filter is "Top", "Live" or "Upcoming", and results come grouped in sections.

js
const { sections } = await client.spaces.search("podcast", { filter: "Upcoming" });

spaces.stream(mediaKey) ​

Resolves the HLS stream of a Space from its media key.

spaces.broadcast(broadcastId, opts?) ​

Gets a broadcast. Same as broadcasts.get.

spaces.browseTopics(opts?) ​

Deprecated. The web client dropped this op and there is no replacement, so emusks calls the old op with { legacy: true }. It may stop working.

Listeners ​

spaces.subscribe(spaceId) / spaces.unsubscribe(spaceId) ​

Sets or removes a reminder for a scheduled Space.

spaces.addSharing(spaceId, tweetId) ​

Shares a tweet into a Space.

spaces.deleteSharing(spaceId, sharingId) ​

Removes a shared tweet.

spaces.react(broadcastId, message, opts?) ​

Sends a room reaction. Needs the live chat sessionId.

spaces.shareListening(enabled?) ​

Turns sharing your listening activity with followers on or off.

Hosts ​

spaces.created(opts?) ​

Gets the Spaces you created.

spaces.analytics(spaceId) ​

Gets host analytics.

spaces.clip(spaceId) ​

Gets clip metadata.

spaces.hostPost(text, opts?) ​

Posts a tweet as the host from inside a Space.

spaces.hostableCommunities() ​

Gets the communities you can host a Space in.

not affiliated with X Corp.