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

# 좋아요

> 포스트에 좋아요를 추가하거나 취소하고, 좋아요 정보를 조회합니다

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

Likes 엔드포인트를 사용하면 포스트에 좋아요를 추가하거나 취소하고, 어떤 사용자가 특정 게시물을 좋아했는지 확인하며, 특정 사용자가 좋아한 포스트를 가져올 수 있습니다.

<div id="overview">
  ## 개요
</div>

<CardGroup cols={2}>
  <Card title="게시물에 좋아요 표시" icon="heart">
    사용자를 대신해 게시물에 좋아요를 표시합니다
  </Card>

  <Card title="게시물 좋아요 취소" icon="heart-crack">
    게시물의 좋아요를 취소합니다
  </Card>

  <Card title="좋아요한 사용자" icon="users">
    게시물에 좋아요를 누른 사용자를 확인합니다
  </Card>

  <Card title="좋아요한 포스트" icon="list-heart">
    사용자가 좋아요한 포스트를 가져옵니다
  </Card>
</CardGroup>

***

<div id="endpoints">
  ## 엔드포인트
</div>

<div id="likes-lookup">
  ### 좋아요 조회
</div>

| Method | Endpoint                                                         | Description         |
| :----- | :--------------------------------------------------------------- | :------------------ |
| GET    | [`/2/tweets/:id/liking_users`](/ko/x-api/posts/get-liking-users) | 게시물에 좋아요를 누른 사용자 조회 |
| GET    | [`/2/users/:id/liked_tweets`](/ko/x-api/users/get-liked-posts)   | 사용자가 좋아요한 포스트 조회    |

<div id="manage-likes">
  ### 좋아요 관리
</div>

| Method | Endpoint                                                      | Description |
| :----- | :------------------------------------------------------------ | :---------- |
| POST   | [`/2/users/:id/likes`](/ko/x-api/users/like-post)             | 게시물에 좋아요 추가 |
| DELETE | [`/2/users/:id/likes/:tweet_id`](/ko/x-api/users/unlike-post) | 게시물의 좋아요 취소 |

***

<div id="important-notes">
  ## 중요 참고 사항
</div>

<Note>
  liking users 엔드포인트는 실제 좋아요 수와 관계없이, 게시물 하나당 전체 기간 동안 좋아요를 누른 사용자 최대 **100명**만 반환합니다.
</Note>

***

<div id="example-get-liking-users">
  ## 예시: 좋아요한 사용자 가져오기
</div>

```bash theme={null}
curl "https://api.x.com/2/tweets/1234567890/liking_users?\
user.fields=username,verified" \
  -H "Authorization: Bearer $BEARER_TOKEN"
```

<div id="example-like-a-post">
  ## 예시: 게시물에 좋아요 표시하기
</div>

```bash theme={null}
curl -X POST "https://api.x.com/2/users/123456789/likes" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"tweet_id": "1234567890"}'
```

***

<div id="getting-started">
  ## 시작하기
</div>

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

  * 승인된 [개발자 계정](https://developer.x.com/en/portal/petition/essential/basic-info)
  * 개발자 콘솔의 [Project 및 App](/ko/resources/fundamentals/developer-apps)
  * App의 [키와 토큰](/ko/resources/fundamentals/authentication)
</Note>

<CardGroup cols={2}>
  <Card title="조회 빠른 시작" icon="heart" href="/ko/x-api/posts/likes/quickstart/likes-lookup">
    게시물의 좋아요 조회
  </Card>

  <Card title="관리 빠른 시작" icon="plus" href="/ko/x-api/posts/likes/quickstart/manage-likes">
    포스트 좋아요 추가 및 취소
  </Card>

  <Card title="API 참조 문서" icon="code" href="/ko/x-api/posts/liking-users-of-a-post">
    전체 엔드포인트 문서
  </Card>

  <Card title="샘플 코드" icon="github" href="https://github.com/xdevplatform/Twitter-API-v2-sample-code">
    실행 가능한 코드 예시
  </Card>
</CardGroup>
