The User lookup endpoints let you retrieve profile information for one or more users. Look up users by their ID, username, or get details for the currently authenticated user.Documentation Index
Fetch the complete documentation index at: https://docs.x.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
By ID
Look up users by their unique user ID
By username
Look up users by their @handle
Multiple users
Retrieve up to 100 users per request
Authenticated user
Get details for the current user
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /2/users/:id | Get user by ID |
| GET | /2/users | Get users by IDs (up to 100) |
| GET | /2/users/by/username/:username | Get user by username |
| GET | /2/users/by | Get users by usernames (up to 100) |
| GET | /2/users/me | Get authenticated user |
Example request
Example response
Getting started
Prerequisites
- An approved developer account
- A Project and App in the Developer Console
- Your App’s keys and tokens
User lookup quickstart
Look up users by ID or username
Authenticated user quickstart
Get the current user’s profile
Integration guide
Key concepts and best practices
API Reference
Full endpoint documentation