> ## 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.

# User Lookup

> Los endpoints de User lookup te permiten recuperar información de perfil de uno o más usuarios. Referencia del nivel estándar de X API v2 sobre 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>;
};

Los endpoints de User lookup te permiten recuperar información de perfil de uno o más usuarios. Consulta usuarios por su ID, username, u obtén detalles del usuario autenticado actualmente.

## Resumen

<CardGroup cols={2}>
  <Card title="Por ID" icon="fingerprint">
    Consulta usuarios por su user ID único
  </Card>

  <Card title="Por username" icon="at">
    Consulta usuarios por su @handle
  </Card>

  <Card title="Múltiples usuarios" icon="https://mintcdn.com/x-preview/SxzTbJaLjs3MidH1/icons/xds/icon-people.svg?fit=max&auto=format&n=SxzTbJaLjs3MidH1&q=85&s=9d5f3f82edcd2a4070364193436e7980" width="24" height="24" data-path="icons/xds/icon-people.svg">
    Recupera hasta 100 usuarios por solicitud
  </Card>

  <Card title="Usuario autenticado" icon="user-check">
    Obtén detalles del usuario actual
  </Card>
</CardGroup>

***

## Endpoints

| Método | Endpoint                                                              | Descripción                                |
| :----- | :-------------------------------------------------------------------- | :----------------------------------------- |
| GET    | [`/2/users/:id`](/x-api/users/get-user-by-id)                         | Obtiene un usuario por ID                  |
| GET    | [`/2/users`](/x-api/users/get-users-by-ids)                           | Obtiene usuarios por IDs (hasta 100)       |
| GET    | [`/2/users/by/username/:username`](/x-api/users/get-user-by-username) | Obtiene un usuario por username            |
| GET    | [`/2/users/by`](/x-api/users/get-users-by-usernames)                  | Obtiene usuarios por usernames (hasta 100) |
| GET    | [`/2/users/me`](/x-api/users/get-my-user)                             | Obtiene el usuario autenticado             |

***

## Solicitud de ejemplo

```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"
```

## Respuesta de ejemplo

```json title="Example response" lines wrap icon="https://mintcdn.com/x-preview/Vn2KEkZaPF9LiPi3/icons/xds/icon-brackets.svg?fit=max&auto=format&n=Vn2KEkZaPF9LiPi3&q=85&s=ed2428e77bab43e57800e1a590e982fa" 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
    }
  }
}
```

***

## Primeros pasos

<Note>
  **Requisitos previos**

  * Una [cuenta de desarrollador](https://developer.x.com/en/portal/petition/essential/basic-info) aprobada
  * Un [Project y App](/resources/fundamentals/developer-apps) en la Developer Console
  * Las [claves y tokens](/resources/fundamentals/authentication) de tu App
</Note>

<CardGroup cols={2}>
  <Card title="Inicio rápido de user lookup" icon="https://mintcdn.com/x-preview/oR-aRNyj1BKPJtxM/icons/xds/icon-rocket.svg?fit=max&auto=format&n=oR-aRNyj1BKPJtxM&q=85&s=b978d7a9225de31709efbbed5b84e92d" href="/x-api/users/lookup/quickstart/user-lookup" width="24" height="24" data-path="icons/xds/icon-rocket.svg">
    Consulta usuarios por ID o username
  </Card>

  <Card title="Inicio rápido de usuario autenticado" icon="https://mintcdn.com/x-preview/SxzTbJaLjs3MidH1/icons/xds/icon-person.svg?fit=max&auto=format&n=SxzTbJaLjs3MidH1&q=85&s=507a4bbcdcf5744bd18781508002e305" href="/x-api/users/lookup/quickstart/authenticated-lookup" width="24" height="24" data-path="icons/xds/icon-person.svg">
    Obtén el perfil del usuario actual
  </Card>

  <Card title="Guía de integración" icon="https://mintcdn.com/x-preview/Vn2KEkZaPF9LiPi3/icons/xds/icon-book.svg?fit=max&auto=format&n=Vn2KEkZaPF9LiPi3&q=85&s=22ac564792481d14ae36a941546039c8" href="/x-api/users/lookup/integrate" width="24" height="24" data-path="icons/xds/icon-book.svg">
    Conceptos clave y mejores prácticas
  </Card>

  <Card title="Referencia de la API" icon="https://mintcdn.com/x-preview/ygI6sSJPehlc0qNT/icons/xds/icon-code.svg?fit=max&auto=format&n=ygI6sSJPehlc0qNT&q=85&s=488e23401b19225b89acc0136d242219" href="/x-api/users/get-user-by-id" width="24" height="24" data-path="icons/xds/icon-code.svg">
    Documentación completa del endpoint
  </Card>
</CardGroup>
