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

# 빠른 시작

> ID나 소유자 기준으로 리스트를 조회합니다

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <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>;
};

이 가이드는 리스트 조회 엔드포인트를 사용해 리스트 정보를 조회하는 방법을 설명합니다.

<Note>
  **사전 준비 사항**

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

  * 승인된 App이 있는 [개발자 계정](https://developer.x.com/en/portal/petition/essential/basic-info)
  * App의 Bearer 토큰
</Note>

***

<div id="get-a-list-by-id">
  ## ID로 리스트 가져오기
</div>

특정 리스트의 세부 정보를 조회합니다:

<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 Python SDK theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_BEARER_TOKEN")

  # ID로 리스트 가져오기
  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로 리스트 가져오기
  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>

<div id="response">
  ### 응답
</div>

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

***

<div id="get-lists-owned-by-a-user">
  ## 사용자가 소유한 리스트 가져오기
</div>

특정 사용자가 소유한 모든 리스트를 조회합니다:

<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 Python SDK theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_BEARER_TOKEN")

  # 페이지네이션을 사용해 사용자가 소유한 리스트 조회
  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 JavaScript SDK theme={null}
  import { Client } from "@xdevplatform/xdk";

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

  // 페이지네이션을 사용해 사용자가 소유한 리스트 조회
  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>

<div id="response">
  ### 응답
</div>

```json 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
  }
}
```

***

<div id="include-owner-information">
  ## 소유자 정보 포함하기
</div>

소유자의 사용자 데이터를 확장하려면:

<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 Python SDK theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_BEARER_TOKEN")

  # 소유자 정보가 포함된 리스트 가져오기
  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 JavaScript SDK theme={null}
  import { Client } from "@xdevplatform/xdk";

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

  // 소유자 정보가 포함된 리스트 가져오기
  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>

<div id="response-with-expansion">
  ### 확장을 포함한 응답
</div>

```json theme={null}
{
  "data": {
    "id": "1234567890",
    "name": "Tech News",
    "description": "Top tech journalists",
    "owner_id": "2244994945"
  },
  "includes": {
    "users": [
      {
        "id": "2244994945",
        "username": "XDevelopers",
        "verified": true
      }
    ]
  }
}
```

***

<div id="available-fields">
  ## 사용 가능한 필드
</div>

| 필드               | 설명            |
| :--------------- | :------------ |
| `description`    | 리스트 설명        |
| `owner_id`       | 소유자의 사용자 ID   |
| `private`        | 리스트가 비공개인지 여부 |
| `member_count`   | 리스트 구성원 수     |
| `follower_count` | 팔로워 수         |
| `created_at`     | 리스트 생성 일시     |

***

<div id="next-steps">
  ## 다음 단계
</div>

<CardGroup cols={2}>
  <Card title="리스트 포스트" icon="list" href="/ko/x-api/lists/list-tweets/quickstart">
    리스트의 포스트 가져오기
  </Card>

  <Card title="리스트 멤버" icon="users" href="/ko/x-api/lists/list-members/quickstart/list-members-lookup">
    리스트 멤버 조회
  </Card>

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

  <Card title="API 참조 문서" icon="code" href="/ko/x-api/lists/list-lookup-by-list-id">
    전체 엔드포인트 문서
  </Card>
</CardGroup>
