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

# Pinned Lists Lookup

> Quickstart for retrieving a user's pinned X Lists with the Enterprise tier pinned Lists lookup endpoint, including authentication and sample responses.

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

This guide walks you through retrieving a user's pinned Lists.

<Note>
  **Prerequisites**

  Before you begin, you'll need:

  * A [developer account](https://developer.x.com/en/portal/petition/essential/basic-info) with an approved App
  * User Access Token (OAuth 1.0a or OAuth 2.0 PKCE)
</Note>

***

## Get pinned Lists

<Steps>
  <Step title="Get your user ID">
    You need your authenticated user's ID. You can find it using the [user lookup endpoint](/x-api/users/lookup/introduction) or from your Access Token (the numeric part is your user ID).
  </Step>

  <Step title="Request pinned Lists">
    <CodeGroup dropdown>
      ```bash cURL theme={null}
      curl "https://api.x.com/2/users/2244994945/pinned_lists?\
      list.fields=follower_count,member_count,owner_id&\
      expansions=owner_id&\
      user.fields=created_at,username" \
        -H "Authorization: Bearer $USER_ACCESS_TOKEN"
      ```

      ```python Python SDK theme={null}
      from xdk import Client

      client = Client(bearer_token="YOUR_USER_ACCESS_TOKEN")

      # Get pinned Lists
      response = client.lists.get_pinned(
          "2244994945",
          list_fields=["follower_count", "member_count", "owner_id"],
          expansions=["owner_id"],
          user_fields=["created_at", "username"]
      )

      for lst in response.data:
          print(f"{lst.name} - {lst.follower_count} followers")
      ```

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

      const client = new Client({ accessToken: "YOUR_USER_ACCESS_TOKEN" });

      // Get pinned Lists
      const response = await client.lists.getPinned("2244994945", {
        listFields: ["follower_count", "member_count", "owner_id"],
        expansions: ["owner_id"],
        userFields: ["created_at", "username"],
      });

      response.data?.forEach((lst) => {
        console.log(`${lst.name} - ${lst.follower_count} followers`);
      });
      ```
    </CodeGroup>
  </Step>

  <Step title="Review the response">
    ```json theme={null}
    {
      "data": [
        {
          "id": "1454155907651158017",
          "name": "Tech News",
          "follower_count": 150,
          "member_count": 25,
          "owner_id": "2244994945"
        }
      ],
      "includes": {
        "users": [
          {
            "id": "2244994945",
            "username": "XDevelopers",
            "name": "X Developers",
            "created_at": "2013-12-14T04:35:55.000Z"
          }
        ]
      },
      "meta": {
        "result_count": 1
      }
    }
    ```
  </Step>
</Steps>

***

## Available List fields

| Field            | Description             |
| :--------------- | :---------------------- |
| `description`    | List description        |
| `owner_id`       | Owner's user ID         |
| `private`        | Whether List is private |
| `member_count`   | Number of members       |
| `follower_count` | Number of followers     |
| `created_at`     | List creation date      |

***

## Next steps

<CardGroup cols={2}>
  <Card title="Manage pinned Lists" icon="thumbtack" href="/x-api/lists/pinned-lists/quickstart/manage-pinned-lists">
    Pin and unpin Lists
  </Card>

  <Card title="List lookup" icon="list" href="/x-api/lists/list-lookup/quickstart">
    Get List details
  </Card>

  <Card title="API Reference" icon="code" href="/x-api/users/get-pinned-lists">
    Full endpoint documentation
  </Card>
</CardGroup>
