7-day offer$199$9
X-Autopilot

X API Spaces: the field every example gets wrong

The X API Spaces endpoints in 2026: all six are read-only, the host_ids in X's own quickstart is not a valid space.field at 2.174, and ended Spaces vanish.

X-Autopilot Team··9 min read
On this page · 9 sections

The short version

  • ▸Six Spaces endpoints exist and every one is a GET. There is no way to create, schedule, end, join or moderate a Space from the API, and there never has been.
  • ▸host_ids appears in X's own Spaces quickstart and in the lookup guide, but it is not in the space.fields enum at API 2.174, and the official Python SDK encodes the same restriction. Host and speaker identities are expansion-only.
  • ▸That matters on 22 November 2026, when expansion objects start billing. The only route to a Space's hosts and speakers becomes a User read at $0.010 each, on top of $0.005 for the Space itself.
  • ▸Spaces search is a case-insensitive substring match on the title. X staff confirmed that operators like OR are not supported, so every extra keyword is another request, and there is no pagination token at all.
  • ▸A Space becomes unretrievable the moment it ends, which makes the ticket-buyers and shared-Posts endpoints useless after the fact. The spaces.start and spaces.end webhook events added in January 2026 are the only workable trigger.

Quick answer

The X API Spaces namespace has six endpoints, all of them GETs, and the single most copied line in its documentation does not work. space.fields=host_ids appears in X's own quickstart, in the lookup guide, and in both SDK samples, but host_ids is not in the space.fields enum at API version 2.174. Hosts and speakers are expansions. That distinction is free today and starts costing $0.010 per user on 22 November 2026.

Last updated: November 2026

Three facts shape everything you can build here. The namespace is read-only. Ended Spaces disappear. And the identities you actually want are not fields.

Six endpoints, and what each one hands back

Spaces on X (formerly Twitter) are live audio rooms. If you want the product rather than the API, we have a separate walkthrough of how to use X Spaces. The API surface is smaller than the product by a long way.

EndpointReturnsBilled asPagination
GET /2/spaces/:idOne Space objectSpace: Read $0.005n/a
GET /2/spacesUp to 100 Spaces by ids$0.005 eachn/a
GET /2/spaces/by/creator_idsSpaces for up to 100 user_ids$0.005 eachnone at all
GET /2/spaces/searchUp to 100 Spaces, default 100$0.005 eachnone at all
GET /2/spaces/:id/buyersUser objectsUser: Read $0.010 eachpagination_token
GET /2/spaces/:id/tweetsPost objectsPosts: Read $0.005 eachpagination_token

Two things in that table are worth pausing on.

max_results defaults to 100 on search, on buyers and on shared Posts. Most v2 endpoints default to 10. So GET /2/spaces/:id/buyers with no parameters is a request to bill up to one dollar, and GET /2/spaces/search?query=ai with no parameters is up to fifty cents. The defaults are the maximums.

And there is no Spaces row on the Owned Reads table in X API pricing. Bookmarks, lists, likes, followers and your own Posts all drop to $0.001 when you read your own data through your own app. Spaces do not. Reading the Space you hosted yourself costs the same $0.005 as reading a stranger's.

host_ids is not a space.field

Here is X's Spaces search quickstart, verbatim:

curl "https://api.x.com/2/spaces/search?query=AI&\
space.fields=title,host_ids,participant_count,state&state=live" \
  -H "Authorization: Bearer $BEARER_TOKEN"

And here is the complete space.fields enum from the live OpenAPI description at api.x.com/2/openapi.json, version 2.174:

created_at, ended_at, id, is_ticketed, lang, participant_count,
scheduled_start, started_at, state, subscriber_count, title, updated_at

Twelve values. No host_ids. No creator_id, speaker_ids, invited_user_ids or topic_ids either. Those five are the expansions enum, which is a different parameter.

This is not a stale sample that the SDKs have quietly corrected. Download xdk 0.10.6, X's own Python SDK, and xdk/spaces/client.py types space_fields as a Literal of exactly those twelve strings, with host_ids appearing only in the expansions literal. The official SDK's type checker rejects the call the official quickstart tells you to make. The lookup guide's "Response fields" table repeats the same mistake, listing host_ids and speaker_ids as fields to request.

Ask for expansions instead:

curl "https://api.x.com/2/spaces/1DXxyRYNejbKM?\
space.fields=title,participant_count,state,started_at&\
expansions=creator_id,host_ids,speaker_ids&\
user.fields=username,name" \
  -H "Authorization: Bearer $BEARER_TOKEN"

Two smaller gaps sit next to this one. The Fields page, whose entire job is to list every *.fields parameter, has rows for Posts, Users, Media, Polls and Places and no row for space.fields. The Expansions page lists four Space expansions and omits topic_ids. And the Spaces introduction links four times to a "Spaces data dictionary" at data-dictionary/reference#space - an anchor that does not exist on that page, which contains example Post payloads and nothing about Spaces. The OpenAPI description is the only authoritative field list, which is exactly the pattern we hit in the X API bookmarks namespace.

On 22 November, the identities start billing

Expansion objects are free right now. They stop being free on 22 November 2026, at Post $0.005, User $0.010, and Media, Poll and Place $0.005 each. The detail is in our write-up of X API expansions.

Put that next to the section above and the arithmetic changes shape. Because host and speaker identities are reachable only through expansions, there is no unpaid path to them after 22 November. A single Space lookup that resolves a creator, two co-hosts and eight speakers goes from $0.005 to $0.005 plus eleven User reads, or $0.115. Deduplication is per 24-hour UTC window, so polling the same Space every 60 seconds for a two-hour show pays for those users once, not 120 times, but a discovery crawl across 100 distinct Spaces pays for every distinct participant.

topic_ids is the odd one out. Topics are not on the read rate card at all, and they were not in the expansion pricing list either, so an expansions=topic_ids request currently has no published price.

Spaces search is a substring match, not a query language

query on /2/spaces/search accepts up to 2,048 characters. It does almost nothing with them.

X staff answered this plainly on 20 November 2024, to a developer who could not understand why query=MAGA OR politics returned zero results while each word alone returned seven and eight: the endpoint "performs exact case-insensitive match of the specified search term," search operators "aren't supported like they are with the Search Tweets endpoints," and "if you want to make multiple queries, you will need to make separate requests for each."

So the practical shape of Spaces search is:

  • One literal, case-insensitive substring, matched against the Space title only. Not the host's bio, not the description, not what is being said.
  • state accepts live, scheduled or all. There is no ended.
  • max_results caps at 100 and there is no pagination_token. Result 101 is unreachable. Permanently.
  • Every synonym you want is another request at up to $0.50.

A keyword-monitoring product therefore costs a multiple of what the docs imply. Ten tracked terms polled every five minutes is 2,880 requests a day, which fits inside 300 per 15 minutes but not inside most budgets.

Ended Spaces are unretrievable, and that breaks two endpoints

X documents this in one sentence on the introduction page: once a Space ends it "will no longer be available for retrieval using the Spaces endpoints." The forum shows what it feels like. A developer in August 2025 queried /2/spaces/by/creator_ids for an account that had definitely hosted Spaces and got meta.result_count: 0; looking the Space up by its own ID returned Not Found. A separate October 2025 report drew the same answer from X staff three days later: no Spaces for that user ID.

Follow that through to the two paginated endpoints. /2/spaces/:id/buyers and /2/spaces/:id/tweets are post-mortem tools by nature - you want them when the show is over. They are only callable while the Space is live. Retrospective Spaces analytics is not a thing you can build on this namespace.

The state field is also looser than it looks. The lookup guide documents three states including ended, and a developer reported back in October 2021 that ended exists but is only visible through lookup by ID. The 2.174 schema resolved this by giving state no enum at all: it is a bare string. Do not switch on it exhaustively.

The webhook is the only trigger that works

Spaces got exactly three changelog entries in five years: the August 2021 launch, the November 2021 addition of ticket buyers and Topics, and then nothing until 28 January 2026, when spaces.start and spaces.end arrived in the X Activity API at $0.005 per delivered event.

That third entry is the one that makes the namespace usable. You subscribe by User ID, get a push the moment a tracked account goes live, and then you have a window in which lookup, buyers and shared Posts all still answer. Poll-and-hope cannot work against a resource that deletes itself.

Note the gap in that list. February 2022 brought /2/spaces/:id/tweets with no changelog entry at all. It appeared in a forum announcement, along with subscriber_count, which counts people who set a reminder for a scheduled Space and - per that same announcement - "is only available to the creator of the Space," requiring OAuth 2.0 with space.read granted by that creator. The field sits in the public enum today with no note attached.

What the namespace still cannot do

  • Create or control a Space. All six endpoints are GETs. No scheduling, no starting, no ending, no promoting a listener to speaker, no muting.
  • Identify listeners. participant_count is an aggregate that includes the hosts. X staff, February 2022: individual attendance is "not included," and an OAuth app cannot see whether a user joined. Still true at 2.174.
  • Find Spaces a user is speaking in. Only by/creator_ids exists, so you can find Spaces someone hosted, never ones they joined as a speaker. A 2022 request for this went to the open-evolution repo and never shipped.
  • Read ticket data in practice. /2/spaces/:id/buyers is the only Spaces endpoint with no app-only Bearer option, OAuth 2.0 user context only, and its externalDocs still points at the dead developer.twitter.com. X paused Ticketed Spaces in October 2022 and the developer changelog has never mentioned the product again.

One more oddity worth knowing before you plan a build: the rate-limits page lists GET /2/users/:id/following/spaces at 300/15min in its Users block. That path has no reference page, no mention in the Spaces namespace, and does not exist in the 2.174 description. Treat it as a ghost row, not a roadmap.

It is telling that the most serious Spaces tool in the forum right now does not use these endpoints at all. On 4 November 2026 a developer requested Public Utility access for a live Spaces reply viewer built on GET /2/tweets/search/stream and /2/tweets/search/recent, estimating $510 to $560 a month in reads. Spaces tooling in 2026 is still built out of Post search.

If what you actually wanted was reach

Most people who find this page are trying to turn Spaces into growth, and run into the fact that the API cannot see listeners, cannot see replays, and cannot see anything once the room closes. The part of the loop that does respond to automation is the Post and reply layer around a Space - the announcement, the live quote-posts, the recap thread.

That is what X-Autopilot does, and it does it from your own Mac in your own logged-in browser session rather than from a shared cloud IP pool, which is a smaller detection surface than a hosted scheduler, not a guarantee of anything. Browser automation of engagement on X is a gray area and we will not tell you otherwise: the API route is the sanctioned one, and X's Automation Rules are the document that governs the rest. Read them before you point any tool at an account you care about.

Frequently asked

Answers indexed by Google + AI assistants.

What are the X API Spaces endpoints?+

Six, all GET: /2/spaces/:id for one Space, /2/spaces for up to 100 IDs at once, /2/spaces/by/creator_ids for up to 100 creators, /2/spaces/search for keyword search, /2/spaces/:id/buyers for ticket buyers, and /2/spaces/:id/tweets for Posts shared in a Space. Five of the six accept an app-only Bearer token. The buyers endpoint is OAuth 2.0 user context only. All six are rate limited at 300 requests per 15 minutes per app and per user, and creator_ids adds a 1 request per second ceiling.

Why does space.fields=host_ids return an error?+

Because host_ids is not in the space.fields enum. At API version 2.174 that enum holds created_at, ended_at, id, is_ticketed, lang, participant_count, scheduled_start, started_at, state, subscriber_count, title and updated_at. The five ID lists - creator_id, host_ids, invited_user_ids, speaker_ids and topic_ids - are expansions, not fields. X's own Spaces search quickstart and Spaces lookup guide both pass host_ids as a field anyway, and the official Python SDK xdk 0.10.6 encodes the restrictive list as a type literal, so the SDK rejects the call X's docs tell you to make.

Can the X API search for Spaces that already ended?+

No. The state parameter on /2/spaces/search accepts only live, scheduled or all, and a Space stops being retrievable once it ends. Lookup by ID returns Not Found and /2/spaces/by/creator_ids returns result_count 0 for a creator whose Spaces are all over. There is no archive endpoint and no replay lookup, so anything you want from a Space has to be captured while it is still live.

How much does an X API Spaces read cost?+

Space: Read is $0.005 per resource on the pay-per-use rate card, and there is no Spaces row on the Owned Reads table, so reading your own Spaces costs the same as reading anyone else's. The buyers endpoint returns Users, which bill at $0.010 each, and the shared-Posts endpoint returns Posts at $0.005 each. Both default max_results to 100, so an unparameterised call to buyers can bill $1.00.

Can I get the list of people who listened to my Space?+

No. participant_count is an aggregate that includes hosts, and there is no per-listener data anywhere in the Space object. X staff answered this directly on 24 February 2022: individual attendance listings are not included, and an OAuth app cannot tell whether a given user joined a Space or for how long. Nothing in the 2.174 schema has changed that.

Is there a webhook for Spaces?+

Yes, and it is the most useful part of the namespace. X added spaces.start and spaces.end to the X Activity API on 28 January 2026. You subscribe by User ID and get told in real time when that account starts or ends a Space, at $0.005 per delivered event. Because ended Spaces disappear from lookup, this is the only reliable way to know a Space happened in time to collect anything from it.

Sources
Related searches
x api spacesx api spaces search/2/spaces/searchget spaces by creator idstwitter spaces api v2x api space.fields host_idsx api spaces ended statespaces.start webhook x apix api pricingx api expansionsx activity apix api rate limitsx spaces analyticsx api v2 endpointspay per use api credits
DY
Deepak YadavBuilding X-Autopilot

Product designer and indie hacker. Runs the agent on his own X account every day and writes up what the data shows, including when it's inconvenient.

Follow on X →
Try X-Autopilot.
7-day offer: $199 $9 once. No subscription, no monthly bill. Real Chrome on your Mac.
See pricing▶
Free PDF · the X Growth Playbook

The exact playbook we use to grow on X

The bio that converts, the daily reply loop, the posting cadence, and the tool stack, in one no-fluff PDF. Drop your email and it's yours.

No spam. Unsubscribe anytime.

Free tools

Try it yourself.

All free X tools →
Keep reading

Related posts.