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

# 퀵스타트

> 이 가이드는 List lookup 엔드포인트를 사용하여 List 정보를 조회하는 방법을 안내합니다. List lookup을 다루는 X API v2 standard 티어 레퍼런스입니다.

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>;
};

이 가이드는 List lookup 엔드포인트를 사용하여 List 정보를 조회하는 방법을 안내합니다.

<Note>
  **사전 요구사항**

  시작하기 전에 다음이 필요합니다:

  * 승인된 App이 포함된 [developer account](https://developer.x.com/en/portal/petition/essential/basic-info)
  * App의 Bearer Token
</Note>

***

## ID로 List 가져오기

특정 List에 대한 세부 정보 조회:

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl "https://api.x.com/2/lists/1234567890?\
  list.fields=description,owner_id,member_count,follower_count,private,created_at" \
    -H "Authorization: Bearer $BEARER_TOKEN"
  ```

  ```python title="Python SDK" lines wrap icon="python" theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_BEARER_TOKEN")

  # ID로 List 가져오기
  response = client.lists.get(
      "1234567890",
      list_fields=["description", "owner_id", "member_count", "follower_count", "private", "created_at"]
  )

  print(f"List: {response.data.name}")
  print(f"Members: {response.data.member_count}")
  ```

  ```javascript JavaScript SDK theme={null}
  import { Client } from "@xdevplatform/xdk";

  const client = new Client({ bearerToken: "YOUR_BEARER_TOKEN" });

  // ID로 List 가져오기
  const response = await client.lists.get("1234567890", {
    listFields: ["description", "owner_id", "member_count", "follower_count", "private", "created_at"],
  });

  console.log(`List: ${response.data?.name}`);
  console.log(`Members: ${response.data?.member_count}`);
  ```
</CodeGroup>

### 응답

```json title="응답 예시" 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": "1234567890",
    "name": "Tech News",
    "description": "Top tech journalists and publications",
    "owner_id": "2244994945",
    "private": false,
    "member_count": 50,
    "follower_count": 1250,
    "created_at": "2023-01-15T10:00:00.000Z"
  }
}
```

***

## 사용자가 소유한 List 가져오기

특정 사용자가 소유한 모든 List 조회:

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl "https://api.x.com/2/users/2244994945/owned_lists?\
  list.fields=description,member_count,follower_count&\
  max_results=100" \
    -H "Authorization: Bearer $BEARER_TOKEN"
  ```

  ```python title="Python SDK" lines wrap icon="python" theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_BEARER_TOKEN")

  # 페이지네이션으로 사용자가 소유한 List 가져오기
  for page in client.lists.get_owned_lists(
      "2244994945",
      list_fields=["description", "member_count", "follower_count"],
      max_results=100
  ):
      for lst in page.data:
          print(f"{lst.name} - {lst.member_count} members")
  ```

  ```javascript title="JavaScript SDK" lines wrap icon="square-js" theme={null}
  import { Client } from "@xdevplatform/xdk";

  const client = new Client({ bearerToken: "YOUR_BEARER_TOKEN" });

  // 페이지네이션으로 사용자가 소유한 List 가져오기
  const paginator = client.lists.getOwnedLists("2244994945", {
    listFields: ["description", "member_count", "follower_count"],
    maxResults: 100,
  });

  for await (const page of paginator) {
    page.data?.forEach((lst) => {
      console.log(`${lst.name} - ${lst.member_count} members`);
    });
  }
  ```
</CodeGroup>

### 응답

```json title="응답 예시" 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": "1234567890",
      "name": "Tech News",
      "description": "Top tech journalists",
      "member_count": 50,
      "follower_count": 1250
    },
    {
      "id": "9876543210",
      "name": "Developer Tools",
      "description": "Useful tools for developers",
      "member_count": 25,
      "follower_count": 500
    }
  ],
  "meta": {
    "result_count": 2
  }
}
```

***

## 소유자 정보 포함

소유자의 user 데이터 확장:

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl "https://api.x.com/2/lists/1234567890?\
  list.fields=description,owner_id&\
  expansions=owner_id&\
  user.fields=username,verified" \
    -H "Authorization: Bearer $BEARER_TOKEN"
  ```

  ```python title="Python SDK" lines wrap icon="python" theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_BEARER_TOKEN")

  # 소유자 정보와 함께 List 가져오기
  response = client.lists.get(
      "1234567890",
      list_fields=["description", "owner_id"],
      expansions=["owner_id"],
      user_fields=["username", "verified"]
  )

  print(f"List: {response.data.name}")
  # 소유자 정보는 response.includes.users에 있음
  ```

  ```javascript title="JavaScript SDK" lines wrap icon="square-js" theme={null}
  import { Client } from "@xdevplatform/xdk";

  const client = new Client({ bearerToken: "YOUR_BEARER_TOKEN" });

  // 소유자 정보와 함께 List 가져오기
  const response = await client.lists.get("1234567890", {
    listFields: ["description", "owner_id"],
    expansions: ["owner_id"],
    userFields: ["username", "verified"],
  });

  console.log(`List: ${response.data?.name}`);
  // 소유자 정보는 response.includes?.users에 있음
  ```
</CodeGroup>

### expansion이 포함된 응답

```json title="응답 예시" 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": "1234567890",
    "name": "Tech News",
    "description": "Top tech journalists",
    "owner_id": "2244994945"
  },
  "includes": {
    "users": [
      {
        "id": "2244994945",
        "username": "XDevelopers",
        "verified": true
      }
    ]
  }
}
```

***

## 사용 가능한 필드

| Field            | Description    |
| :--------------- | :------------- |
| `description`    | List 설명        |
| `owner_id`       | 소유자의 사용자 ID    |
| `private`        | List가 비공개인지 여부 |
| `member_count`   | 멤버 수           |
| `follower_count` | 팔로워 수          |
| `created_at`     | List 생성 날짜     |

***

## 다음 단계

<CardGroup cols={2}>
  <Card title="List Posts" icon="https://mintcdn.com/x-preview/ygI6sSJPehlc0qNT/icons/xds/icon-bulleted-list.svg?fit=max&auto=format&n=ygI6sSJPehlc0qNT&q=85&s=b9bf8323233df59c682b0fec8e3f88d5" href="/x-api/lists/list-tweets/quickstart" width="24" height="24" data-path="icons/xds/icon-bulleted-list.svg">
    List에서 Post 가져오기
  </Card>

  <Card title="List 멤버" icon="https://mintcdn.com/x-preview/SxzTbJaLjs3MidH1/icons/xds/icon-people.svg?fit=max&auto=format&n=SxzTbJaLjs3MidH1&q=85&s=9d5f3f82edcd2a4070364193436e7980" href="/x-api/lists/list-members/quickstart/list-members-lookup" width="24" height="24" data-path="icons/xds/icon-people.svg">
    List 멤버 가져오기
  </Card>

  <Card title="List 관리" icon="pen" href="/x-api/lists/manage-lists/quickstart">
    List 생성 및 업데이트
  </Card>

  <Card title="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/lists/list-lookup-by-list-id" width="24" height="24" data-path="icons/xds/icon-code.svg">
    전체 엔드포인트 문서
  </Card>
</CardGroup>
