> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-mintlify-5e62557c.mintlify.site/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-mintlify-5e62557c/dxXIRy5tzOESXfjK/icons/xds/icon-people.svg?fit=max&auto=format&n=dxXIRy5tzOESXfjK&q=85&s=3df3f471186c3b149f8bf206d86587e3" 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-mintlify-5e62557c/QVCcrJRuVU5c6Fli/icons/xds/icon-brackets.svg?fit=max&auto=format&n=QVCcrJRuVU5c6Fli&q=85&s=8c7124cd379f973762b135033c4e3df8" 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-mintlify-5e62557c/7ox7QZkMlDBhUtvj/icons/xds/icon-rocket.svg?fit=max&auto=format&n=7ox7QZkMlDBhUtvj&q=85&s=b6c3ee24b3b5aff4ba4a87805d56fdc9" 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-mintlify-5e62557c/dxXIRy5tzOESXfjK/icons/xds/icon-person.svg?fit=max&auto=format&n=dxXIRy5tzOESXfjK&q=85&s=b9f49bc6c7deb6ad896faddec9f3be35" 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-mintlify-5e62557c/QVCcrJRuVU5c6Fli/icons/xds/icon-book.svg?fit=max&auto=format&n=QVCcrJRuVU5c6Fli&q=85&s=730ef6392554051da0ff5f79a1698c62" 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-mintlify-5e62557c/NnGYBQFO1PDkJQK7/icons/xds/icon-code.svg?fit=max&auto=format&n=NnGYBQFO1PDkJQK7&q=85&s=e6a5208c5ad4cc59a4a97fed7db5ed00" 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>
