Skip to main content
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.

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

MethodEndpointDescription
GET/2/users/:idGet user by ID
GET/2/usersGet users by IDs (up to 100)
GET/2/users/by/username/:usernameGet user by username
GET/2/users/byGet users by usernames (up to 100)
GET/2/users/meGet authenticated user

Example request

curl "https://api.x.com/2/users/by/username/XDevelopers?\
user.fields=created_at,description,public_metrics,verified" \
  -H "Authorization: Bearer $BEARER_TOKEN"

Example response

{
  "data": {
    "id": "2244994945",
    "name": "X Developers",
    "username": "XDevelopers",
    "created_at": "2013-12-14T04:35:55.000Z",
    "description": "The voice of the X developer community",
    "verified": true,
    "public_metrics": {
      "followers_count": 583423,
      "following_count": 2048,
      "tweet_count": 14052,
      "listed_count": 1672
    }
  }
}

Getting started

Prerequisites