X

X Users API

Endpoints related to retrieving, managing relationships of Users — 42 operation(s) in the X-published contract.

Operations 44

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /2/users Look up several users by ID · Get Users by IDs #
Ask an LLM
“Can I fetch profiles for a batch of user IDs at once?”
“Which profile fields can I request for multiple users by ID?”
Tell an agent
Get the users with IDs {ids}.
Look up user IDs {ids} with fields {fields}.
GET /2/users/by Look up several users by username · Get Users by Usernames #
Ask an LLM
“How do I turn a list of @handles into user profiles in one call?”
“Can I resolve multiple usernames to user IDs together?”
Tell an agent
Look up the users {usernames}.
Get profiles for these handles at once: {usernames}.
GET /2/users/by/username/{username} Look up one user by username (v2) · Get Users by Username #
Ask an LLM
“What's the v2 way to get a single profile from an @handle?”
“Can I include a user's pinned post when looking them up by username?”
Tell an agent
Get the v2 profile for @{username}.
Look up @{username} and expand {expansions}.
GET /2/users/me Get the authenticated user's profile · Get Users Me #
Ask an LLM
“Which account is my access token acting as?”
“How can I get my own user ID and profile?”
Tell an agent
Show my own profile.
Get my authenticated account with fields {fields}.
GET /2/users/public_keys Get Chat public keys for several users · Get public keys #
Ask an LLM
“Can I fetch the X Chat encryption public keys for a batch of users?”
“What public keys are registered for multiple user IDs?”
Tell an agent
Get Chat public keys for users {ids}.
Fetch encryption keys for {ids} in one request.
GET /2/users/reposts_of_me See reposts of my posts · Get Users Reposts of Me #
Ask an LLM
“Which of my posts have other people reposted?”
“Can I page through reposts of my own content?”
Tell an agent
Show reposts of my posts.
List the latest {max_results} reposts of my content.
GET /2/users/search Search for users by keyword · Search Users #
Ask an LLM
“What accounts match a name or keyword?”
“Can I search users and page through the matches?”
Tell an agent
Search users for {query}.
Find up to {max_results} accounts matching {query}.
GET /2/users/{id} Look up one user by ID (v2) · Get Users by ID #
Ask an LLM
“What's the v2 call for a single user profile by numeric ID?”
“Can I request specific profile fields for one user ID?”
Tell an agent
Get the v2 profile for user {id}.
Look up user {id} with fields {fields} on v2.
GET /2/users/{id}/affiliates List a user's affiliate accounts · Get Users Affiliates #
Ask an LLM
“Which affiliated accounts are linked to an organization's profile?”
“Can I page through a user's affiliates?”
Tell an agent
List the affiliates of user {id}.
Show {max_results} affiliate accounts for {id}.
GET /2/users/{id}/blocking List accounts I've blocked · Get Users Blocking #
Ask an LLM
“Which accounts have I blocked?”
“Can I export my full block list?”
Tell an agent
List the accounts user {id} is blocking.
Show {max_results} blocked accounts for {id}.
GET /2/users/{id}/bookmarks List my bookmarked posts · Get Users Bookmarks #
Ask an LLM
“What posts have I bookmarked?”
“Can I export all my bookmarks through the API?”
Tell an agent
Show bookmarks for user {id}.
List the latest {max_results} posts {id} has bookmarked.
POST /2/users/{id}/bookmarks Bookmark a post · Create Users Bookmark #
Ask an LLM
“Can I save a post to my bookmarks programmatically?”
“Can I bookmark a post straight into a specific folder?”
Tell an agent
Bookmark post {tweet_id} for user {id}.
Save post {tweet_id} into bookmark folder {folder_id} for {id}.
GET /2/users/{id}/bookmarks/folders List my bookmark folders · Get Users Bookmark Folders #
Ask an LLM
“Which bookmark folders have I created?”
“Can I list all bookmark folders on my account?”
Tell an agent
List bookmark folders for user {id}.
Show {max_results} of {id}'s bookmark folders.
POST /2/users/{id}/bookmarks/folders Create a bookmark folder · Create Bookmark Folder #
Ask an LLM
“Can I organize my bookmarks by creating a new folder?”
“What's needed to make a named bookmark folder?”
Tell an agent
Create a bookmark folder called {name} for user {id}.
Make a new folder {name} in {id}'s bookmarks.
GET /2/users/{id}/bookmarks/folders/{folder_id} List bookmarks in one folder · Get Users Bookmarks by Folder ID #
Ask an LLM
“Which posts are saved in a particular bookmark folder?”
“Can I read just one bookmark folder's contents?”
Tell an agent
Show the bookmarks in folder {folder_id} for user {id}.
List {max_results} posts saved in bookmark folder {folder_id} of {id}.
DELETE /2/users/{id}/bookmarks/{tweet_id} Remove a post from my bookmarks · Delete Bookmark #
Ask an LLM
“What's the call to unbookmark a post?”
“Can I remove a saved post from my bookmarks by its ID?”
Tell an agent destructive · confirm first
Remove post {tweet_id} from {id}'s bookmarks.
Unbookmark {tweet_id} for user {id}.
POST /2/users/{id}/dm/block Block a user from DMing me · Block Users Dms #
Ask an LLM
“Can I stop a specific user from sending me Direct Messages?”
“Is there a DM-only block for an account?”
Tell an agent
Block DMs from user {id}.
Stop {id} from sending me direct messages.
POST /2/users/{id}/dm/unblock Allow DMs from a user again · Unblock Users Dms #
Ask an LLM
“How do I let a user I DM-blocked message me again?”
“Can I lift a Direct Message block on an account?”
Tell an agent
Unblock DMs from user {id}.
Let {id} send me direct messages again.
GET /2/users/{id}/followed_lists List the Lists a user follows · Get Users Followed Lists #
Ask an LLM
“Which Lists does an account follow?”
“Can I page through all Lists a user is following?”
Tell an agent
Show the Lists user {id} follows.
Get {max_results} Lists followed by {id}.
POST /2/users/{id}/followed_lists Follow a List · Follow List #
Ask an LLM
“How do I follow a List so its posts show up for me?”
“Can I follow someone else's public List?”
Tell an agent
Follow List {list_id} as user {id}.
Have {id} start following List {list_id}.
DELETE /2/users/{id}/followed_lists/{list_id} Unfollow a List · Unfollow a List #
Ask an LLM
“Is there a way to stop following a List?”
“Can I unfollow a List by its ID?”
Tell an agent destructive · confirm first
Unfollow List {list_id} for user {id}.
Have {id} stop following List {list_id}.
GET /2/users/{id}/followers List a user's followers · Get Users Followers #
Ask an LLM
“Who follows a given account?”
“Can I page through all of a user's followers?”
Tell an agent
List the followers of user {id}.
Get {max_results} followers of {id}.
GET /2/users/{id}/following List accounts a user follows · Get Users Following #
Ask an LLM
“Which accounts does a user follow?”
“Can I get the full following list for an account?”
Tell an agent
List the accounts user {id} follows.
Get {max_results} accounts that {id} is following.
POST /2/users/{id}/following Follow a user · Follow User #
Ask an LLM
“Can I follow another account via the API?”
“Can my app follow a user on behalf of the signed-in account?”
Tell an agent
Follow user {target_user_id} as {id}.
Have {id} follow {target_user_id}.
GET /2/users/{id}/liked_tweets List posts a user has liked · Get Users Liked Posts #
Ask an LLM
“Which posts has an account liked?”
“Can I page through a user's liked posts?”
Tell an agent
Show posts liked by user {id}.
Get the last {max_results} posts {id} liked.
POST /2/users/{id}/likes Like a post · Like Post #
Ask an LLM
“Is liking a post possible through the API?”
“Can my app like a post for the signed-in user?”
Tell an agent
Like post {tweet_id} as user {id}.
Have {id} like {tweet_id}.
DELETE /2/users/{id}/likes/{tweet_id} Unlike a post · Unlike Post #
Ask an LLM
“Can I take back a like I gave a post?”
“Can I undo a like by the post's ID?”
Tell an agent destructive · confirm first
Unlike post {tweet_id} for user {id}.
Remove {id}'s like on {tweet_id}.
GET /2/users/{id}/list_memberships List the Lists a user belongs to · Get Users List Memberships #
Ask an LLM
“Which Lists has an account been added to?”
“Can I see every List that includes a particular user?”
Tell an agent
Show the Lists that include user {id}.
Get {max_results} List memberships for {id}.
GET /2/users/{id}/mentions Get posts mentioning a user · Get Users Mentions #
Ask an LLM
“Who has mentioned an account recently?”
“Can I get a user's mentions within a date range?”
Tell an agent
Show posts mentioning user {id}.
Get mentions of {id} between {start_time} and {end_time}.
GET /2/users/{id}/muting List accounts I've muted · Get Users Muting #
Ask an LLM
“Which accounts have I muted?”
“Can I export my mute list?”
Tell an agent
List the accounts user {id} has muted.
Show {max_results} muted accounts for {id}.
POST /2/users/{id}/muting Mute a user · Mute User #
Ask an LLM
“How do I mute an account so I stop seeing their posts?”
“Can my app mute someone for the signed-in user?”
Tell an agent
Mute user {target_user_id} for {id}.
Have {id} mute {target_user_id}.
GET /2/users/{id}/owned_lists List the Lists a user owns · Get Users Owned Lists #
Ask an LLM
“Which Lists has an account created?”
“Can I page through all Lists a user owns?”
Tell an agent
Show the Lists owned by user {id}.
Get {max_results} Lists that {id} created.
GET /2/users/{id}/pinned_lists List a user's pinned Lists · Get Users Pinned Lists #
Ask an LLM
“Which Lists has a user pinned?”
“Can I see my pinned Lists with their owner details?”
Tell an agent
Show the pinned Lists of user {id}.
Get {id}'s pinned Lists with fields {fields}.
POST /2/users/{id}/pinned_lists Pin a List · Pin List #
Ask an LLM
“Can I pin a List to the top of my Lists?”
“Can I pin a List by its ID for the signed-in user?”
Tell an agent
Pin List {list_id} for user {id}.
Have {id} pin List {list_id}.
DELETE /2/users/{id}/pinned_lists/{list_id} Unpin a List · Unpin a List #
Ask an LLM
“What removes a List from my pinned set?”
“Can I remove a List from my pinned Lists?”
Tell an agent destructive · confirm first
Unpin List {list_id} for user {id}.
Have {id} unpin List {list_id}.
GET /2/users/{id}/public_keys Get one user's Chat public keys · Get public keys #
Ask an LLM
“What Chat encryption keys has a single user registered?”
“Where do I get one person's public key before messaging them in XChat?”
Tell an agent
Get the Chat public keys of user {id}.
Show {id}'s registered encryption keys.
POST /2/users/{id}/retweets Repost a post · Repost Post #
Ask an LLM
“How do I repost a post to my followers?”
“Can my app repost something for the signed-in user?”
Tell an agent
Repost post {tweet_id} as user {id}.
Have {id} repost {tweet_id}.
DELETE /2/users/{id}/retweets/{source_tweet_id} Undo a repost · Unrepost Post #
Ask an LLM
“Is it possible to undo a repost?”
“Can I remove my repost of a post by its ID?”
Tell an agent destructive · confirm first
Undo the repost of {source_tweet_id} for user {id}.
Have {id} unrepost {source_tweet_id}.
GET /2/users/{id}/timelines/reverse_chronological Get a user's home timeline · Get Users Timeline #
Ask an LLM
“What's in my home timeline in reverse chronological order?”
“Can I pull my home feed for a time range, excluding some post types?”
Tell an agent
Show the home timeline for user {id}.
Get {id}'s home feed from {start_time} to {end_time} excluding {exclude}.
GET /2/users/{id}/tweets Get posts written by a user · Get Users Posts #
Ask an LLM
“What has a particular account posted recently?”
“Can I fetch a user's own posts while excluding some post types?”
Tell an agent
Show the posts authored by user {id}.
Get {id}'s posts since post {since_id}, excluding {exclude}.
DELETE /2/users/{source_user_id}/following/{target_user_id} Unfollow a user · Unfollow User #
Ask an LLM
“What's the way to unfollow an account?”
“Can my app unfollow someone on behalf of the signed-in user?”
Tell an agent destructive · confirm first
Unfollow {target_user_id} as {source_user_id}.
Have {source_user_id} stop following {target_user_id}.
DELETE /2/users/{source_user_id}/muting/{target_user_id} Unmute a user · Unmute User #
Ask an LLM
“Can I unmute an account I muted earlier?”
“Can I start seeing a muted user's posts again?”
Tell an agent destructive · confirm first
Unmute {target_user_id} for {source_user_id}.
Have {source_user_id} unmute {target_user_id}.
GET /users/{id} Look up a user by ID (unversioned endpoint) · Look up a user by ID #
Ask an LLM
“Is there a legacy non-/2 route to look up a user by ID?”
“Which unversioned endpoint returns a user from their numeric ID?”
Tell an agent
Look up user {id} via the unversioned /users endpoint.
Use the legacy user-by-ID route for {id}.
GET /users/by/username/{username} Look up a user by username (unversioned) · Look up a user by username #
Ask an LLM
“Does the older unversioned API still resolve an @handle to a profile?”
“Which unversioned endpoint returns a profile for a username?”
Tell an agent
Look up @{username} via the unversioned /users/by/username route.
Use the legacy user-by-username endpoint for {username}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/x:x-users-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

x-users-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: X Users API
  version: '1.0'
  description: 'Operations tagged Users across 2 of this provider''s published API definitions: x-api-v2-openapi.json, x-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- description: X API
  url: https://api.x.com
- url: https://api.x.com/2
  description: X API v2 production server
tags:


# --- truncated at 32 KB (146 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/x/refs/heads/main/openapi/x-users-api-openapi.yml