Space
A Space with its hosts, speakers and audience.
GET
apiKeyheader
AuthorizationBearer <token>An API key from the dashboard: Authorization: Bearer sapi_….
url?stringThe Space's link (https://x.com/i/spaces/1OyKAWNBLewJb).
id?stringThe Space's id, instead of url.
maxAge?integerHow old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.
Format
int64Range
0 <= valueThe answer.
application/json- response
One item, as every single-item endpoint answers: { "data": … }.
data*A Space: a live audio conversation.
import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data } = await client.x.space({ url: "https://x.com/i/spaces/1OyKAWNBLewJb" });Example Response
{ "data": { "live": false, "roomId": "1OyKAWNBLewJb", "title": "#AskNASA: Climate Science Q&A", "viewers": null, "startedAt": "2024-04-18T18:57:41.659Z", "coverUrl": null, "host": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "ext": { "state": "ended", "scheduledAt": "2024-04-18T19:00:00.000Z", "endedAt": "2024-04-18T20:02:42.692Z", "replay": true, "listeners": 13420, "replayViews": 25193, "admins": [ { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, { "id": "15461733", "username": "NASAClimate", "displayName": "ARCHIVED - NASA Climate", "avatarUrl": "https://pbs.twimg.com/profile_images/1936100731549011968/EywhjyCE_400x400.png", "verified": false, "url": "https://x.com/NASAClimate" } ], "speakers": [ { "id": "1451773004", "username": "Space_Station", "displayName": "International Space Station", "avatarUrl": "https://pbs.twimg.com/profile_images/1949871812176732160/ZesOirrR_400x400.jpg", "verified": true, "url": "https://x.com/Space_Station" }, { "id": "24919888", "username": "NASAEarth", "displayName": "NASA Earth", "avatarUrl": "https://pbs.twimg.com/profile_images/2040064373323083776/2ez7ntt1_400x400.jpg", "verified": true, "url": "https://x.com/NASAEarth" }, { "id": "189253902", "username": "NASAScience_", "displayName": "NASA Science", "avatarUrl": "https://pbs.twimg.com/profile_images/2046257502250258432/Ja13oc9e_400x400.jpg", "verified": true, "url": "https://x.com/NASAScience_" } ], "streamUrl": "https://prod-fastly-a.video.pscp.tv/Transcoding/v1/hls/iQ2UWMLo1lfHeyBXddNbWBV8FKm7_X3nG8js-bjgO-qSMNNRiKZ-X_5xOhwEA4eWvclUrm291g7RKWUHA2azVQ/non_transcode/us-east-1/periscope-replay-direct-prod-us-east-1-public/audio-space/playlist_16733273508508111373.m3u8?type=replay", "postId": "1781034388731408737" } }}