TwittrAPI

v1.2.0
io.github.twittrapi/twittrapi-mcp Checked 4 days ago Published 1 month ago

Read public Twitter/X data: tweets, profiles, followers, search.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_user_by_username Get user by username

Get an X (Twitter) user's profile by handle: name, bio, follower/following counts, verification, created date, and the numeric user ID (rest_id) needed by other tools.

ParameterTypeDescription
username *stringX handle without the URL, e.g. "elonmusk" (a leading @ is fine).
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_user_by_id Get user by ID

Get an X user's profile by numeric user ID (rest_id). Same data as get_user_by_username.

ParameterTypeDescription
userId *stringNumeric X user ID (rest_id).
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

username_to_id Username to user ID

Resolve an X handle to its numeric user ID. Cheaper and smaller than get_user_by_username when you only need the ID.

ParameterTypeDescription
username *stringX handle without the URL, e.g. "elonmusk" (a leading @ is fine).
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

users_by_ids Get users by IDs

Get profiles for up to 500 X users in one call, by numeric user ID.

ParameterTypeDescription
ids *arrayNumeric X user IDs, 1 to 500.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_user_tweets Get user tweets

Get a user's recent tweets (their profile timeline, without replies), newest first, including retweets and pinned tweet. Paginated.

ParameterTypeDescription
countintegerHow many tweets to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.
userIdstringNumeric X user ID (rest_id). Provide this or username. Using the ID is faster.
usernamestringX handle, used when you do not have the user ID. Provide this or userId.

get_user_tweets_and_replies Get user tweets and replies

Get a user's tweets including their replies to others, newest first. Paginated.

ParameterTypeDescription
countintegerHow many tweets to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.
userIdstringNumeric X user ID (rest_id). Provide this or username. Using the ID is faster.
usernamestringX handle, used when you do not have the user ID. Provide this or userId.

get_user_media Get user media

Get a user's tweets that contain photos or videos. Paginated.

ParameterTypeDescription
countintegerHow many tweets to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.
userIdstringNumeric X user ID (rest_id). Provide this or username. Using the ID is faster.
usernamestringX handle, used when you do not have the user ID. Provide this or userId.

get_followers Get followers

Get accounts that follow a user, newest followers first. Paginated.

ParameterTypeDescription
countintegerHow many users to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.
userIdstringNumeric X user ID (rest_id). Provide this or username. Using the ID is faster.
usernamestringX handle, used when you do not have the user ID. Provide this or userId.

get_following Get following

Get accounts a user follows. Paginated.

ParameterTypeDescription
countintegerHow many users to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.
userIdstringNumeric X user ID (rest_id). Provide this or username. Using the ID is faster.
usernamestringX handle, used when you do not have the user ID. Provide this or userId.

get_verified_followers Get verified followers

Get a user's followers that have a verified (blue check) badge. Paginated.

ParameterTypeDescription
countintegerHow many users to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.
userIdstringNumeric X user ID (rest_id). Provide this or username. Using the ID is faster.
usernamestringX handle, used when you do not have the user ID. Provide this or userId.

get_user_affiliates Get affiliates

Get the accounts affiliated with an organization, as in the Affiliates tab of its profile. Empty for accounts without affiliates. Paginated.

ParameterTypeDescription
countintegerHow many users to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.
userIdstringNumeric X user ID (rest_id). Provide this or username. Using the ID is faster.
usernamestringX handle, used when you do not have the user ID. Provide this or userId.

get_friendships_batch Get relationships with many accounts

Check whether one account follows up to 50 others, and whether they follow it back, in one call. Returns raw JSON: one relationship per target, in order, plus errors for handles that could not be looked up.

ParameterTypeDescription
sourceUsername *stringThe account to compare with the others, e.g. "jack" (a leading @ is fine).
targetUsernames *arrayAccounts to check, 1 to 50 X handles (a leading @ is fine). Billed as one call per handle.
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_user_about_batch Get "About this account" for many users

Get the "About this account" data (country the account is based in, username changes, verification) of up to 20 accounts in one call. Returns raw JSON: one entry per handle, in order, plus errors for handles that could not be looked up.

ParameterTypeDescription
usernames *arrayAccounts to look up, 1 to 20 X handles (a leading @ is fine). Billed as one call per handle.
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

search_tweets Search tweets

Search X like the search box. Supports X search operators in the query, e.g. from:user, to:user, "exact phrase", lang:en, since:2025-01-01, until:2025-02-01, min_faves:100, filter:media, -filter:replies. category Latest gives newest first; People returns accounts instead of tweets. Paginated.

ParameterTypeDescription
searchItem *stringSearch query, max 512 characters. May contain X search operators.
categorystringResult tab: Top (default), Latest, People, Photos or Videos.
countintegerHow many results to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_tweet Get tweet

Get a tweet by ID with full text, author, media, engagement counts and the reply thread (conversation). Use cursor to load more replies.

ParameterTypeDescription
tweetId *stringNumeric tweet ID, the number at the end of a tweet URL.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.
rankingModestringSort order. Default Relevance.

get_tweet_retweets Get tweet retweeters

Get the users who retweeted a tweet. Paginated.

ParameterTypeDescription
tweetId *stringNumeric tweet ID.
countintegerHow many users to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_tweet_quotes Get tweet quotes

Get tweets that quote a given tweet. Paginated.

ParameterTypeDescription
tweetId *stringNumeric tweet ID.
countintegerHow many tweets to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_tweet_replies Get tweet replies

Get only the replies to a tweet, without the tweet itself or the tweets above it. Paginated.

ParameterTypeDescription
tweetId *stringNumeric tweet ID.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
includePromotedContentbooleanInclude promoted replies (default false).
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.
rankingModestringSort order. Default Relevance.

get_tweet_thread Get tweet thread

Get the author's own thread around a tweet in reading order: their tweets above it and their replies to themselves below it, up to the first reply by someone else.

ParameterTypeDescription
tweetId *stringNumeric tweet ID.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_list_details Get list details

Get an X list's name, description, owner, and member/follower counts.

ParameterTypeDescription
listId *stringNumeric list ID, from the list URL.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_list_tweets Get list tweets

Get the tweet timeline of an X list (tweets from its members), newest first. Paginated.

ParameterTypeDescription
listId *stringNumeric list ID.
countintegerHow many tweets to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_list_members Get list members

Get the accounts that are members of an X list. Paginated.

ParameterTypeDescription
listId *stringNumeric list ID.
countintegerHow many users to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_community Get community

Get an X Community's name, description, rules, member count and admins.

ParameterTypeDescription
communityId *stringNumeric community ID.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_community_about Get community about page

Get the About page of an X Community: description, rules, creation date, moderators and a preview of members. Returns raw JSON.

ParameterTypeDescription
communityId *stringNumeric community ID.
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_community_tweets Get community tweets

Get tweets posted in an X Community. Paginated.

ParameterTypeDescription
communityId *stringNumeric community ID.
countintegerHow many tweets to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

search_communities Search communities

Search X Communities by keyword. Returns community IDs for get_community and get_community_tweets. Paginated.

ParameterTypeDescription
searchTerm *stringKeyword to search for.
countintegerHow many communities to request per page (default 20). X may return slightly more or fewer.
cursorstringPagination cursor. Leave empty for the first page; pass the next_cursor from a previous result to get the next page.
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_trend_locations Get trend locations

List the locations (countries and cities) that have trends, with their WOEIDs for get_trends.

ParameterTypeDescription
formatstringResponse format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls,…
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.

get_space Get Space

Get an X Space by ID: title, state, host and participants, and whether a replay is available. Returns raw JSON.

ParameterTypeDescription
spaceId *stringSpace ID, the letters and digits at the end of the Space URL (x.com/i/spaces/<spaceId>).
max_charsintegerMaximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response.