# Twitter / X API — UnifAPI

> Users, posts, search, trends, lists, communities. Read public X (Twitter) users, posts, search, trends, lists and communities, plus relationship checks, as unified JSON under /x/....

- Category: Social platforms
- API base URL: https://api.unifapi.com
- Auth: `Authorization: Bearer <UnifAPI API key>` (OAuth recommended for MCP clients)
- MCP server: https://mcp.unifapi.com
- Developer docs: https://docs.unifapi.com/api/x
- OpenAPI spec: https://unifapi.com/openapi.json
- HTML page: https://unifapi.com/apis/twitter
- Full catalog: https://unifapi.com/apis.md

## Agent workflows

- Use the Twitter / X API to get public users by handle, list followers and following, search posts, and read trends, lists, communities, and follow-relationship checks for market or creator research.
- Give KOL pricing and competitive-intelligence agents a stable Twitter / X data contract instead of brittle browser automation.
- Batch identities and posts into comparable response shapes for monitoring, enrichment, ranking, or evidence-backed outreach briefs.

## Endpoints (35)

Every endpoint returns the UnifAPI JSON envelope (`request_id`, `data`, `pagination` on lists, `billing`) and bills max(records × credits per record, minimum) in credits.

### Autocomplete X users, topics, hashtags, and cashtags

`GET /x/autocomplete`

Return X search autocomplete suggestions for a partial query, grouped into matching users, topics, hashtags, and cashtags. Useful for type-ahead search, entity discovery, and expanding a seed term into related handles and tags.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `query` (query)
- Details: https://unifapi.com/apis/twitter/autocomplete/get
- Docs: https://docs.unifapi.com/api/x/autocomplete/get

### Get X Community by ID

`GET /x/communities/{id}`

Return a single X Community by its ID, including name, description, member count, and other public metadata. Useful for resolving a Community's profile before pulling its Posts or members.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/communities/id/get
- Docs: https://docs.unifapi.com/api/x/communities/id/get

### Get an X Community about timeline

`GET /x/communities/{id}/about`

Return the "about" timeline for an X Community — the pinned and descriptive Posts that introduce the group — as a cursor-paginated list. Useful for understanding a Community's purpose and rules before engaging.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/communities/id/about/get
- Docs: https://docs.unifapi.com/api/x/communities/id/about/get

### Get media Posts from an X Community

`GET /x/communities/{id}/media`

Return only the media-bearing Posts (images and video) from an X Community, as a cursor-paginated list. Useful for surfacing the visual content shared within a group.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/communities/id/media/get
- Docs: https://docs.unifapi.com/api/x/communities/id/media/get

### Search members in an X Community

`GET /x/communities/{id}/member_search`

Search within an X Community's membership by query string and return matching members as a cursor-paginated list of profiles. Useful for finding specific people inside a large Community.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path), `query` (query)
- Details: https://unifapi.com/apis/twitter/communities/id/member_search/get
- Docs: https://docs.unifapi.com/api/x/communities/id/member_search/get

### Get members of an X Community

`GET /x/communities/{id}/members`

Return the accounts that belong to an X Community, as a cursor-paginated list of full profiles. Useful for mapping the membership of a topic-based group.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/communities/id/members/get
- Docs: https://docs.unifapi.com/api/x/communities/id/members/get

### Get moderators of an X Community

`GET /x/communities/{id}/moderators`

Return the moderators of an X Community, as a cursor-paginated list of full profiles. Useful for identifying who governs a group and the key accounts to reach.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/communities/id/moderators/get
- Docs: https://docs.unifapi.com/api/x/communities/id/moderators/get

### Get Posts from an X Community

`GET /x/communities/{id}/tweets`

Return the timeline of Posts shared inside an X Community, as a cursor-paginated list. Useful for monitoring discussion within a topic-based group.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/communities/id/tweets/get
- Docs: https://docs.unifapi.com/api/x/communities/id/tweets/get

### Search X Communities

`GET /x/communities/search`

Search X Communities by query string and return a cursor-paginated set of matching Communities with their metadata. Useful for discovering active topic-based groups to monitor or analyze.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `query` (query)
- Details: https://unifapi.com/apis/twitter/communities/search/get
- Docs: https://docs.unifapi.com/api/x/communities/search/get

### Check whether one X user follows another

`GET /x/friendships/show`

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. Useful for verifying connections and detecting one-way follows.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Details: https://unifapi.com/apis/twitter/friendships/show/get
- Docs: https://docs.unifapi.com/api/x/friendships/show/get

### Get followers/subscribers of an X List

`GET /x/lists/{id}/followers`

Return the accounts that subscribe to (follow) an X List, as a cursor-paginated list of full profiles. Useful for sizing and analyzing the audience that tracks a curated List.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/lists/id/followers/get
- Docs: https://docs.unifapi.com/api/x/lists/id/followers/get

### Get members of an X List

`GET /x/lists/{id}/members`

Return the accounts that belong to an X List, as a cursor-paginated list of full profiles. Useful for extracting a curated audience or seed set of accounts around a theme.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/lists/id/members/get
- Docs: https://docs.unifapi.com/api/x/lists/id/members/get

### Get Posts from an X List

`GET /x/lists/{id}/tweets`

Return the combined timeline of Posts from the members of an X List, as a cursor-paginated list. Useful for following a hand-curated set of accounts as a single topical feed.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/lists/id/tweets/get
- Docs: https://docs.unifapi.com/api/x/lists/id/tweets/get

### Search X Lists

`GET /x/lists/search`

Search public X Lists by query string and return a cursor-paginated set of matching Lists with their metadata. Useful for discovering curated account collections around a topic, industry, or community.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `query` (query)
- Details: https://unifapi.com/apis/twitter/lists/search/get
- Docs: https://docs.unifapi.com/api/x/lists/search/get

### Get X trends by WOEID

`GET /x/trends/by/woeid/{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. Useful for region-specific trend tracking and timing content to live conversations.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `woeid` (path)
- Details: https://unifapi.com/apis/twitter/trends/by/woeid/woeid/get
- Docs: https://docs.unifapi.com/api/x/trends/by/woeid/woeid/get

### Get X Posts by IDs

`GET /x/tweets`

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. Useful for hydrating a set of Posts without one request each.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `ids` (query)
- Details: https://unifapi.com/apis/twitter/tweets/get
- Docs: https://docs.unifapi.com/api/x/tweets/get

### Get X Post by ID

`GET /x/tweets/{id}`

Fetch a single X (Twitter) Post by its numeric ID — the classic get-tweet-by-ID lookup — returning text, author, timestamp, language, and public metrics (likes, reposts, replies, quotes, and views). Useful for hydrating a known Post or checking its current engagement.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/tweets/id/get
- Docs: https://docs.unifapi.com/api/x/tweets/id/get

### Get the article-style payload for an X Post

`GET /x/tweets/{id}/article`

Return the long-form X Article payload attached to a Post, including its full text body and authoring metadata. Useful for extracting complete article content from Posts that carry it, rather than only the short Post text.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/tweets/id/article/get
- Docs: https://docs.unifapi.com/api/x/tweets/id/article/get

### Get users who liked an X Post

`GET /x/tweets/{id}/liking_users`

Return the accounts that liked a given X Post, as a cursor-paginated list of full profiles. Useful for analyzing who engaged with a Post and surfacing an interested audience.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/tweets/id/liking_users/get
- Docs: https://docs.unifapi.com/api/x/tweets/id/liking_users/get

### Get quote Posts for an X Post

`GET /x/tweets/{id}/quote_tweets`

Return the quote Posts that reference a given X Post, as a cursor-paginated list with author and metrics for each quote. Useful for measuring how a Post is being amplified and what commentary it is attracting.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/tweets/id/quote_tweets/get
- Docs: https://docs.unifapi.com/api/x/tweets/id/quote_tweets/get

### Get users who reposted an X Post

`GET /x/tweets/{id}/retweeted_by`

Return the accounts that reposted (retweeted) a given X Post, as a cursor-paginated list of full profiles. Useful for identifying who amplified a Post and mapping the audience that spread it.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/tweets/id/retweeted_by/get
- Docs: https://docs.unifapi.com/api/x/tweets/id/retweeted_by/get

### Translate an X Post

`GET /x/tweets/{id}/translation`

Return a machine translation of an X Post's text into a target language code (e.g. `zh`, `es`). Useful for monitoring non-native-language conversations and normalizing multilingual Posts into one working language.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path), `language` (query)
- Details: https://unifapi.com/apis/twitter/tweets/id/translation/get
- Docs: https://docs.unifapi.com/api/x/tweets/id/translation/get

### Search recent X Posts

`GET /x/tweets/search/recent`

Search recent public X Posts matching a query string and return a cursor-paginated list of Posts with author and metrics — a drop-in Twitter search API for tracking keywords, hashtags, cashtags, brand mentions, and breaking conversations in near real time.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `query` (query)
- Details: https://unifapi.com/apis/twitter/tweets/search/recent/get
- Docs: https://docs.unifapi.com/api/x/tweets/search/recent/get

### Get X users by IDs

`GET /x/users`

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. Useful for hydrating profiles behind a list of IDs without one request per account.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `ids` (query)
- Details: https://unifapi.com/apis/twitter/users/get
- Docs: https://docs.unifapi.com/api/x/users/get

### Get X user by ID

`GET /x/users/{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. Useful when you already hold a stable user ID and need the current profile.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/users/id/get
- Docs: https://docs.unifapi.com/api/x/users/id/get

### Get an X user's followers

`GET /x/users/{id}/followers`

Return a cursor-paginated followers list for a given X (Twitter) user — every account that follows them, with a full profile object per follower. Useful for audience analysis and mapping who follows a brand, creator, or competitor.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/users/id/followers/get
- Docs: https://docs.unifapi.com/api/x/users/id/followers/get

### Get follower IDs for an X user

`GET /x/users/{id}/followers/ids`

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. Useful for large-scale audience snapshots and set comparisons such as follower overlap between two accounts.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/users/id/followers/ids/get
- Docs: https://docs.unifapi.com/api/x/users/id/followers/ids/get

### Get users followed by an X user

`GET /x/users/{id}/following`

Return a cursor-paginated following list — the accounts a given X (Twitter) user follows, with full profile objects. Useful for mapping an account's interest graph and the people it pays attention to.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/users/id/following/get
- Docs: https://docs.unifapi.com/api/x/users/id/following/get

### Get following IDs for an X user

`GET /x/users/{id}/following/ids`

Return only the numeric user IDs that an X user follows as a cursor-paginated list, without the full profile bodies. Useful for efficiently capturing an account's outbound follow graph for overlap and diffing analysis.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/users/id/following/ids/get
- Docs: https://docs.unifapi.com/api/x/users/id/following/ids/get

### Get Posts liked by an X user

`GET /x/users/{id}/liked_tweets`

Return the Posts an X user has liked, as a cursor-paginated list. Useful for understanding an account's interests and engagement signals beyond the content it publishes itself.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/users/id/liked_tweets/get
- Docs: https://docs.unifapi.com/api/x/users/id/liked_tweets/get

### Translate an X user profile

`GET /x/users/{id}/profile_translation`

Return a machine translation of an X user's profile text (such as the bio) into a target language code. Useful for understanding non-native-language profiles when analyzing international accounts.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path), `language` (query)
- Details: https://unifapi.com/apis/twitter/users/id/profile_translation/get
- Docs: https://docs.unifapi.com/api/x/users/id/profile_translation/get

### Get Posts authored by an X user

`GET /x/users/{id}/tweets`

Return a cursor-paginated timeline of Posts authored by an X user, newest first, optionally dropping replies via the `exclude` parameter. Each page carries a cursor for fetching older Posts — useful for profiling an account's content, monitoring an author, or archiving a feed.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/users/id/tweets/get
- Docs: https://docs.unifapi.com/api/x/users/id/tweets/get

### Get verified followers for an X user

`GET /x/users/{id}/verified_followers`

Return the subset of an X user's followers that carry a verified badge, as a cursor-paginated list of full profiles. Useful for gauging an account's reach among notable or paying accounts.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/twitter/users/id/verified_followers/get
- Docs: https://docs.unifapi.com/api/x/users/id/verified_followers/get

### Get X users by usernames

`GET /x/users/by`

Batch-resolve up to 100 X accounts from a comma-separated list of @handles in a single call, returning one profile object per username. Useful for converting a list of handles into user IDs and profile data in one request.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `usernames` (query)
- Details: https://unifapi.com/apis/twitter/users/by/get
- Docs: https://docs.unifapi.com/api/x/users/by/get

### Get X user by username

`GET /x/users/by/username/{username}`

Look up an X (Twitter) account by its @handle (without the leading @) and return the full public profile, including the numeric user ID — the standard way to get a Twitter user ID from a username before calling the follower, timeline, and relationship endpoints. Useful as the entry point when you only know a username.

- Price: 1 credit per record, minimum 1 credit ($0.001) per call
- Required: `username` (path)
- Details: https://unifapi.com/apis/twitter/users/by/username/username/get
- Docs: https://docs.unifapi.com/api/x/users/by/username/username/get

## Related APIs

- [Threads API](https://unifapi.com/apis/threads/index.md) — Posts, replies, reposts, search
- [YouTube API](https://unifapi.com/apis/youtube/index.md) — Channels, videos, comments, captions, playlists, hashtags, search, trending
- [Reddit API](https://unifapi.com/apis/reddit/index.md) — Subreddits, posts, comments, feeds, search
- [Instagram API](https://unifapi.com/apis/instagram/index.md) — Profiles, posts, reels, stories, comments, audio, search
- [Facebook API](https://unifapi.com/apis/facebook/index.md) — Pages, posts, reels, groups, events, Marketplace, Ad Library
- [LinkedIn API](https://unifapi.com/apis/linkedin/index.md) — People, companies, posts, jobs, ads, search
