X Spaces
X Spaces, formerly Twitter Spaces, are live audio rooms on X, each with a title, a status that moves from scheduled to live to ended, a main host with any co-hosts, the speakers brought on stage, and counts of the people who listened live and the times the recording was replayed. Those details let you report on the reach of a single Space, follow a recurring show episode by episode and see which voices keep turning up on stage in a field.
X Spaces API Features
- Any Space link, at any stageSubmit https://x.com/i/spaces/<id> links to the X Spaces API for Spaces that are scheduled, live or already over, and each one returns a single row.
- Status and timingstatus reads scheduled, live, ended or canceled, with scheduled_start_at for the planned start and published_at for when the Space was created.
- Everyone on stageauthor is the main host, hosts lists the host and co-hosts, and speakers lists the accounts invited to speak, each with id, username, name, avatar and verified flag.
- Live and replay audiencemetrics.live_listeners_count is the total number of people who listened while the Space was live, and metrics.replay_views_count counts plays of the recording afterwards.
- Replay availabilityis_replay_available shows whether the Space can still be played back on X once it has ended.
X Spaces API Parameters
| Parameters | Required | Description |
|---|---|---|
urls | Required | X Space links in the form https://x.com/i/spaces/<space_id>, one per line; scheduled, live and ended Spaces are all accepted. |
How to Use the X Spaces API
Submit Space links to the X Spaces API and read one row per Space.
- POST {"urls": ["https://x.com/i/spaces/1OdWgBerXWvaQz"]} to /v1/x/space.
- Poll GET /v1/tasks/{task_id} until status is succeeded.
- Read each Space from results.items; for long batches, keep passing results.next_cursor while has_more is true.
curl -X POST "https://api.socq.ai/v1/x/space" \
-H "Authorization: Bearer $SOCQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"urls":["https://x.com/i/spaces/1OdWgBerXWvaQz"]}'
# hosts repeats the main host from author and adds any co-hosts.X Spaces API Use Cases
- Reporting on a Space you hosted or sponsored: Put live_listeners_count, replay_views_count and the speaker lineup of each Space into a post-event report for a client or sponsor.
- Tracking a competitor's audio show: Collect the links of a rival's recurring Spaces and compare listeners, replays and guests from one episode to the next.
- Building a list of active speakers in a niche: Gather the speakers and co-hosts of the Spaces in your field and count how often each account appears on stage.
- Checking a scheduled Space's lineup: Read scheduled_start_at and hosts before an event, then look the Space up again to see whether its status became ended or canceled.
X Spaces API Pro Tips
- Collect a Space again with the X Spaces API once status is ended to record its final live listener total, and store replay_views_count with collected_at, since replays keep adding plays while is_replay_available is true.
- Count co-hosts as hosts minus the author entry; the main host appears in both fields.
- Key speakers on id when you combine several Spaces, so the same person is counted once even after a username change.
Related APIs
Beyond the X Spaces API, use these APIs when you need a different type of public X data.
- Twitter Tweet Scraper API — Retrieve public post text, authors, engagement, media, hashtags, mentions, and conversation relationships from x.com or twitter.com status URLs.
- Twitter Profile Scraper API — Retrieve public account identity, biographies, avatars, cover images, account status, and visible audience statistics by username.
- Twitter User Tweets Scraper API — Collect recent public posts, authors, media, hashtags, mentions, and engagement by username with replies excluded.
- X Post Quotes API — Collect public quote posts for known status URLs with commentary, authors, engagement, media, timestamps, and source-post context.
- Twitter Mentions API — Collect public posts mentioning a specified account.
- X Account Location API — Look up the country an account is based in, how it connects to X, its join date and username changes.
- Twitter Search API
- X Followers List API
- X Following List API
- X Post Replies API
- X Post Retweeters API
- X Trends API
- Twitter User Search API
- X Community API
- X Community Posts API
- X Thread Context API
- X Verified Followers API
- X List Tweets API
- Twitter List Members API
- Twitter List Followers API
- X Community Members API
- X Community Moderators API
- X Communities Search API
- X Articles API
- Twitter Media Scraper API
- X User Replies API
- Twitter Follow Checker API
- Twitter Video Transcript API