Communities

Community Tweets

Fetch the post timeline of an X Community, cursor-paginated as full tweet objects, with optional ordering control. The community's pinned post is returned as its own field rather than mixed into the feed, because X delivers it under a different timeline instruction and does not repeat it in the feed. Billed at $0.0008 per call. Cost: $0.0008 per call.

get/community/tweets

Request

  • Base URL: https://api.twitterapis.com/twitter
  • URL: https://api.twitterapis.com/twitter/community/tweets
  • Auth: HTTP bearer

Query parameters

community_idstring required

The numeric community id, the digits in a x.com/i/communities/<id> URL.

Example:1493446837214187523
cursorstring

Pagination cursor from a previous response's next_cursor. Omit on the first call.

countinteger

Page size. Defaults to 20 and is clamped to 1-100. A non-numeric value is a 400.

ranking_modestring

Ordering, sent to X as a real upstream parameter rather than applied as a local sort. Recency is the default. Relevance is also accepted, matching the two orderings X's community tab offers, but Recency is the one to depend on. Any other value is a 400.

Example:Recency
fieldsstring

Comma-separated list of dotted field paths to keep in the response (one parameter, never repeated), applied to every object in the returned lists and to nested objects (for example fields=id,text,author.username; the list's own name may prefix a path, fields=tweets.id). A path prefix that lands on an array applies to each element (media.media_url_https). Pagination and envelope keys (next_cursor, cursor, has_more, count, partial, error, message, reason) are always kept. Unknown paths are ignored; up to 50 paths of up to 6 segments. Projection never changes status codes or billing, and applies to data reads only: account, feedback, session status, monitor (other than deliveries), webhook and stream-compat reads return their bodies unchanged.

compact'1'

Set to 1 (or true) to apply the built-in compact preset: ids, url, text, created_at, lang, the engagement counts, the is_retweet/is_reply/is_quote flags, conversation ids, the author's id/username/name/followers_count/verification, and the quoted or retweeted tweet's id/url/author username. The preset trims what it recognises and leaves alone what it would empty, so it never turns a body into {}. Combine with fields to add paths on top of the preset. Typically cuts a tweet page by 70 to 90 percent for LLM tool callers.

paid_promotion'only' | 'exclude'

Filter this page's tweets by X's Paid partnership label: only keeps tweets whose is_paid_promotion is true, exclude keeps the rest. Omit it for every tweet. It filters the page X returned and does not fetch more, so a filtered page can hold fewer tweets than asked for, or none, while next_cursor still pages on. The response carries paid_promotion_filter { mode, kept, removed }, and count reflects what is returned. Any other value is a 400. Billing is the same as without it.

Response

Page through a community's post timeline, with the pinned post returned separately.

pinnedobject nullable

The community's PINNED post as a full tweet object, or null when the community has none. It is its own field and is NOT included in tweets: X delivers it under a separate timeline instruction and does not repeat it in the feed, so a parser that reads only the feed drops it without a trace. In one large community we sampled it was the rules post, which is usually the single most useful item in the response. A client that wants one flat list should read pinned first, then tweets.

next_cursorstring nullable

Opaque cursor for the next page, or null when there is none. Pass it back as ?cursor=.

has_moreboolean

True when this page returned tweets and carried a usable next_cursor. False on the final page.

Changes

No recorded changes to this operation across all 1 revision of this API.