API endpoint reference
39 read endpoints. All are GET requests with the key in the X-API-KEY header, and each call is billed once.
Responses are X's own JSON, passed through (see Response format). Endpoints that act on your own X account, such as posting or liking, are under Account actions. Machine-readable: OpenAPI 3.1 spec (YAML) and every endpoint in one Markdown file, llms-full.txt.
Users
Profiles, timelines, followers, following and ID lookups.
- GET
/user/by/username/{username}User by username: Profile of one account by handle, including its numeric user ID. - GET
/user/{userId}User by ID: Profile of one account by numeric user ID. - GET
/user/users/by/idsUsers by IDs: Profiles of up to 100 accounts in one call. - GET
/user/usernames/to/idsUsernames to IDs: Numeric user IDs for up to 100 handles in one call. - GET
/username/to/id/{username}Username to ID: Numeric user ID for one handle. Smaller response than the full profile. - GET
/user/about/{username}About this account: The data behind X's "About this account" panel (account location, join date, username changes and similar). - GET
/user/{userId}/tweetsUser tweets: Tweets from a profile timeline (without replies), newest first. - GET
/user/{userId}/tweetsAndRepliesUser tweets and replies: Tweets and replies from a profile, newest first. - GET
/user/{userId}/mediaUser media: Tweets with photos or videos from a profile. - GET
/user/{userId}/likesUser likes: Tweets a user has liked. - GET
/user/{userId}/followersFollowers: Accounts that follow a user, newest first. - GET
/user/{userId}/followingsFollowing: Accounts a user follows. - GET
/user/{userId}/verifiedFollowersVerified followers: Followers of a user that have a verified (blue) badge. - GET
/user/{userId}/articlesUser articles: X Articles (long-form posts) published by a user. - GET
/user/usernames/statusAccount status for many handles: Whether each handle is active, suspended, protected or not found. Up to 500 handles per call. - GET
/user/friendships/showRelationship between two accounts: Whether one account follows another, and the other way round.
Tweets
A tweet with replies, likers, retweeters and quotes.
- GET
/tweet/{tweetId}Tweet with replies: A tweet with its author, media, counts and the reply thread. - GET
/simpletweet/{tweetId}Single tweet: One tweet by ID, without the reply thread. Smaller than /tweet/{tweetId}. - GET
/tweet/{tweetId}/articleTweet with article content: Like /tweet/{tweetId}, but also asks X for the full content of an X Article attached to the tweet. - GET
/tweet/{tweetId}/favoritesUsers who liked a tweet: Accounts that liked a tweet. - GET
/tweet/{tweetId}/retweetsUsers who retweeted a tweet: Accounts that retweeted a tweet. - GET
/tweet/{tweetId}/quotesQuote tweets: Tweets that quote a tweet.
Search
Search tweets and people with X's search operators.
Lists
Details, tweets, members and followers of public lists.
- GET
/lists/detailsList details: Name, description, owner and member and subscriber counts of a list. - GET
/lists/tweetsList tweets: Tweets from the members of a list, newest first. - GET
/lists/membersList members: Accounts that are members of a list. - GET
/lists/followersList followers: Accounts that follow (subscribe to) a list.
Communities
Search communities, read details, members, moderators and tweets.
- GET
/communities/search/{searchTerm}Search communities: Find X Communities by keyword. - GET
/communities/{communityId}Community details: Name, description, rules, member count and admins of a community. - GET
/communities/{communityId}/tweetsCommunity tweets: Tweets posted in a community. - GET
/communities/{communityId}/membersCommunity members: Members of a community. - GET
/communities/{communityId}/members/searchSearch community members: Find members of a community whose handle matches a text. - GET
/communities/{communityId}/moderatorsCommunity moderators: Moderators and admins of a community.
Jobs
Search job listings posted on X.
Trends
Trending topics by location (WOEID).
Misc
Hashflags (hashtags with a custom emoji).