Twitter / X API
Public-data Twitter / X endpoints.
Public-data Twitter / X endpoints.
When To Use This API
The Twitter / X API is for agent workflows that need public, platform-native data without writing a custom collector for every task. Use it when a prompt needs evidence from live social records, when a Skill needs repeatable enrichment, or when product code needs the same contract an agent discovered through MCP.
This section lists 35 live Twitter / X operations from the canonical OpenAPI spec. Each operation page documents the route, method, parameters, response envelope, pagination behavior when available, and the error vocabulary shared across UnifAPI.
- Fetch public X users, posts, lists, communities, trends, search results, and relationship checks.
- Give market, KOL, and competitive-intelligence agents a stable Twitter / X data contract.
- Batch public identities and posts into comparable response shapes for ranking, monitoring, or enrichment.
Agent Contract Notes
Agents usually discover these endpoints with the hosted UnifAPI MCP server, inspect the operation schema, then call only the records needed for the current task. Developers can call the same endpoints over HTTP with an API key, which makes the path from exploratory agent run to production integration direct.
Every successful response uses a stable envelope with a request id, data payload, optional pagination cursor, and billing metadata. Errors use the same closed vocabulary across platforms, so retry logic, user-facing explanations, and cost reporting can stay consistent even when a workflow spans multiple public-data sources.
When you are choosing an operation, start from the public identifier the user already has: a profile username, post id, channel id, subreddit name, search term, or URL-derived slug. Prefer the narrowest endpoint that answers the question, then expand only when the agent needs more evidence. This keeps record usage predictable, makes citations easier to explain, and avoids turning a focused research task into an expensive crawl.
Operations
Autocomplete
GET /x/autocomplete— Autocomplete X users, topics, hashtags, and cashtags — Return X search autocomplete suggestions for a partial query, grouped into matching users, topics, hashtags, and cashtags.
Communities
GET /x/communities/{id}/about— Get an X Community about timeline — Return the "about" timeline for an X Community — the pinned and descriptive Posts that introduce the group — as a cursor-paginated list.GET /x/communities/{id}/media— Get media Posts from an X Community — Return only the media-bearing Posts (images and video) from an X Community, as a cursor-paginated list.GET /x/communities/{id}/member_search— Search members in an X Community — Search within an X Community's membership by query string and return matching members as a cursor-paginated list of profiles.GET /x/communities/{id}/members— Get members of an X Community — Return the accounts that belong to an X Community, as a cursor-paginated list of full profiles.GET /x/communities/{id}/moderators— Get moderators of an X Community — Return the moderators of an X Community, as a cursor-paginated list of full profiles.GET /x/communities/{id}— Get X Community by ID — Return a single X Community by its ID, including name, description, member count, and other public metadata.GET /x/communities/{id}/tweets— Get Posts from an X Community — Return the timeline of Posts shared inside an X Community, as a cursor-paginated list.GET /x/communities/search— Search X Communities — Search X Communities by query string and return a cursor-paginated set of matching Communities with their metadata.
Friendships
GET /x/friendships/show— Check whether one X user follows another — Return the directional follow relationship between two X accounts — whether the source follows the target and vice versa — identified by user IDs or screen names.
Lists
GET /x/lists/{id}/followers— Get followers/subscribers of an X List — Return the accounts that subscribe to (follow) an X List, as a cursor-paginated list of full profiles.GET /x/lists/{id}/members— Get members of an X List — Return the accounts that belong to an X List, as a cursor-paginated list of full profiles.GET /x/lists/{id}/tweets— Get Posts from an X List — Return the combined timeline of Posts from the members of an X List, as a cursor-paginated list.GET /x/lists/search— Search X Lists — Search public X Lists by query string and return a cursor-paginated set of matching Lists with their metadata.
Trends
GET /x/trends/by/woeid/{woeid}— Get X trends by WOEID — Return the current trending topics for a location identified by its WOEID (Yahoo "Where On Earth" ID), each with its name and, when available, associated Post volume.
Tweets
GET /x/tweets/{id}/article— Get the article-style payload for an X Post — Return the long-form X Article payload attached to a Post, including its full text body and authoring metadata.GET /x/tweets/{id}/liking_users— Get users who liked an X Post — Return the accounts that liked a given X Post, as a cursor-paginated list of full profiles.GET /x/tweets/{id}/quote_tweets— Get quote Posts for an X Post — Return the quote Posts that reference a given X Post, as a cursor-paginated list with author and metrics for each quote.GET /x/tweets/{id}/retweeted_by— Get users who reposted an X Post — Return the accounts that reposted (retweeted) a given X Post, as a cursor-paginated list of full profiles.GET /x/tweets/{id}— Get X Post by ID — Fetch a single X (Twitter) Post by its numeric ID and return the full object — text, author, timestamp, language, and public metrics (likes, reposts, replies, quotes, and views).GET /x/tweets/{id}/translation— Translate an X Post — Return a machine translation of an X Post's text into a target language code (e.g.GET /x/tweets— Get X Posts by IDs — Batch-fetch up to 100 Posts in one call from a comma-separated list of numeric Post IDs, returning the same full object as the single-Post lookup.GET /x/tweets/search/recent— Search recent X Posts — Search recent public X Posts matching a query string and return a cursor-paginated list of Posts with author and metrics.
Users
GET /x/users/{id}/followers/ids— Get follower IDs for an X user — Return only the numeric user IDs of an X user's followers as a cursor-paginated list — a lighter, faster payload than full follower profiles.GET /x/users/{id}/followers— Get an X user's followers — Return a cursor-paginated list of the accounts that follow a given X user, with a full profile object per follower.GET /x/users/{id}/following/ids— Get following IDs for an X user — Return only the numeric user IDs that an X user follows as a cursor-paginated list, without the full profile bodies.GET /x/users/{id}/following— Get users followed by an X user — Return a cursor-paginated list of the accounts a given X user follows, with full profile objects.GET /x/users/{id}/liked_tweets— Get Posts liked by an X user — Return the Posts an X user has liked, as a cursor-paginated list.GET /x/users/{id}/profile_translation— Translate an X user profile — Return a machine translation of an X user's profile text (such as the bio) into a target language code.GET /x/users/{id}— Get X user by ID — Resolve a single X (Twitter) account by its numeric user ID and return the full public profile — handle, display name, bio, follower and following counts, verification status, and profile media.GET /x/users/{id}/tweets— Get Posts authored by an X user — Return a cursor-paginated timeline of Posts authored by an X user, newest first, optionally dropping replies via theexcludeparameter.GET /x/users/{id}/verified_followers— Get verified followers for an X user — Return the subset of an X user's followers that carry a verified badge, as a cursor-paginated list of full profiles.GET /x/users/by— Get X users by usernames — Batch-resolve up to 100 X accounts from a comma-separated list of @handles in a single call, returning one profile object per username.GET /x/users/by/username/{username}— Get X user by username — Look up an X (Twitter) account by its @handle (without the leading @) and return the full public profile, including the numeric user ID required by the follower, timeline, and relationship endpoints.GET /x/users— Get X users by IDs — Batch-resolve up to 100 X accounts in one call from a comma-separated list of numeric user IDs, returning the same profile fields as the single-user lookup.