X (Twitter)
communitySocial media platform for real-time public conversation, news, and microblogging (formerly Twitter).
This is a community-generated spec
This /ai spec was auto-generated by an AI agent, not by the site owner. It may be incomplete or inaccurate.
GET
https://api.x.com/2/tweets/search/recentSearch recent tweets
Parameters
querysearch query with operators (stringrequiredmax_results10-100 (integeroptionaltweet.fieldscreated_atoptional— public_metrics, author_id (stringReturns
data[] with id, text, created_at, public_metrics with retweet_count, like_countGET
https://api.x.com/2/users/by/username/{username}Get user profile
Parameters
usernamehandle without @ (stringrequireduser.fieldsdescriptionoptional— public_metrics, profile_image_url, verified (stringReturns
data with id, name, username, description, public_metrics with followers_count, tweet_countGET
https://api.x.com/2/users/{id}/tweetsGet tweets from a user
Parameters
iduser ID (stringrequiredmax_results5-100 (integeroptionaltweet.fieldscreated_atoptional— public_metrics (stringReturns
data[] with id, text, created_at, public_metrics