> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-mintlify-9d700c6d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# User Lookup

> The User lookup endpoints let you retrieve profile information for one or more users. Reference for the X API v2 standard tier covering lookup.

export const Button = ({href, children}) => {
  return <div className="not-prose">
    <a href={href}>
      <button className="x-btn">
        <span>{children}</span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

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

<CardGroup cols={2}>
  <Card title="By ID" icon="fingerprint">
    Look up users by their unique user ID
  </Card>

  <Card title="By username" icon="at">
    Look up users by their @handle
  </Card>

  <Card title="Multiple users" icon="https://mintcdn.com/x-preview-mintlify-9d700c6d/Uqh_zhhltsn_QkV2/icons/xds/icon-people.svg?fit=max&auto=format&n=Uqh_zhhltsn_QkV2&q=85&s=8ff11ae02f3c404d1ee7bdc72809d060" width="24" height="24" data-path="icons/xds/icon-people.svg">
    Retrieve up to 100 users per request
  </Card>

  <Card title="Authenticated user" icon="user-check">
    Get details for the current user
  </Card>
</CardGroup>

***

## Endpoints

| Method | Endpoint                                                              | Description                        |
| :----- | :-------------------------------------------------------------------- | :--------------------------------- |
| GET    | [`/2/users/:id`](/x-api/users/get-user-by-id)                         | Get user by ID                     |
| GET    | [`/2/users`](/x-api/users/get-users-by-ids)                           | Get users by IDs (up to 100)       |
| GET    | [`/2/users/by/username/:username`](/x-api/users/get-user-by-username) | Get user by username               |
| GET    | [`/2/users/by`](/x-api/users/get-users-by-usernames)                  | Get users by usernames (up to 100) |
| GET    | [`/2/users/me`](/x-api/users/get-my-user)                             | Get authenticated user             |

***

## Example request

```bash theme={null}
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

```json title="Example response" lines wrap icon="https://mintcdn.com/x-preview-mintlify-9d700c6d/G_OnzbBfTF_Y0FQj/icons/xds/icon-brackets.svg?fit=max&auto=format&n=G_OnzbBfTF_Y0FQj&q=85&s=3ab4f8460f351fb29f1facd352190559" theme={null}
{
  "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

<Note>
  **Prerequisites**

  * An approved [developer account](https://developer.x.com/en/portal/petition/essential/basic-info)
  * A [Project and App](/resources/fundamentals/developer-apps) in the Developer Console
  * Your App's [keys and tokens](/resources/fundamentals/authentication)
</Note>

<CardGroup cols={2}>
  <Card title="User lookup quickstart" icon="https://mintcdn.com/x-preview-mintlify-9d700c6d/kbL9WUaTIOuwFB4v/icons/xds/icon-rocket.svg?fit=max&auto=format&n=kbL9WUaTIOuwFB4v&q=85&s=51f5bca8263b75b65b784fdcb99c2dc4" href="/x-api/users/lookup/quickstart/user-lookup" width="24" height="24" data-path="icons/xds/icon-rocket.svg">
    Look up users by ID or username
  </Card>

  <Card title="Authenticated user quickstart" icon="https://mintcdn.com/x-preview-mintlify-9d700c6d/Uqh_zhhltsn_QkV2/icons/xds/icon-person.svg?fit=max&auto=format&n=Uqh_zhhltsn_QkV2&q=85&s=c3946d6eb88c40ea2e964cc0403b0315" href="/x-api/users/lookup/quickstart/authenticated-lookup" width="24" height="24" data-path="icons/xds/icon-person.svg">
    Get the current user's profile
  </Card>

  <Card title="Integration guide" icon="https://mintcdn.com/x-preview-mintlify-9d700c6d/G_OnzbBfTF_Y0FQj/icons/xds/icon-book.svg?fit=max&auto=format&n=G_OnzbBfTF_Y0FQj&q=85&s=ef8326be826f24d6569cb98eaa4383f8" href="/x-api/users/lookup/integrate" width="24" height="24" data-path="icons/xds/icon-book.svg">
    Key concepts and best practices
  </Card>

  <Card title="API Reference" icon="https://mintcdn.com/x-preview-mintlify-9d700c6d/2TQynzjsT-IQoZGU/icons/xds/icon-code.svg?fit=max&auto=format&n=2TQynzjsT-IQoZGU&q=85&s=3b315c61f6b86808a709612dacd273d0" href="/x-api/users/get-user-by-id" width="24" height="24" data-path="icons/xds/icon-code.svg">
    Full endpoint documentation
  </Card>
</CardGroup>
