Documentation Index
Fetch the complete documentation index at: https://generaltranslation.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
이 가이드는 X API를 사용하여 북마크한 포스트를 가져오는 방법을 단계별로 설명합니다.
사전 준비 사항시작하기 전에 다음이 필요합니다:
- 승인된 App이 있는 개발자 계정
bookmark.read 범위를 가진 User Access Token(OAuth 2.0 PKCE)
내 사용자 ID 가져오기
인증된 사용자 ID가 필요합니다. /2/users/me 엔드포인트를 사용하거나 사용자 조회 엔드포인트에서 확인할 수 있습니다. 북마크 요청하기
curl "https://api.x.com/2/users/2244994945/bookmarks?\
tweet.fields=created_at,public_metrics,author_id&\
max_results=10" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN"
응답 확인하기
{
"data": [
{
"id": "1501258597237342208",
"text": "X API로 만든 프로젝트를 커뮤니티와 공유하고 싶으신가요? 여러분의 이야기를 듣고 싶습니다!",
"created_at": "2024-01-15T10:30:00.000Z",
"author_id": "2244994945",
"public_metrics": {
"retweet_count": 15,
"reply_count": 8,
"like_count": 89,
"quote_count": 3
}
},
{
"id": "1501258542258348032",
"text": "이것은 개발자의 혁신이 X를 더 나은 공간으로 만드는 많은 방법 중 하나일 뿐입니다...",
"created_at": "2024-01-15T09:15:00.000Z",
"author_id": "2244994945",
"public_metrics": {
"retweet_count": 22,
"reply_count": 5,
"like_count": 156,
"quote_count": 7
}
}
],
"meta": {
"result_count": 2,
"next_token": "7140dibdnow9c7btw4539n0vybdnx19ylpayqf16fjt4l"
}
}
게시물 작성자 데이터를 가져오려면 expansions를 사용하세요:
curl "https://api.x.com/2/users/2244994945/bookmarks?\
tweet.fields=created_at,author_id&\
expansions=author_id&\
user.fields=username,verified" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN"
OAuth 2.0 PKCE를 사용할 때 액세스 토큰에는 다음 scope가 포함되어야 합니다:
| Scope | Description |
|---|
bookmark.read | 북마크 읽기 |
tweet.read | 게시물 데이터 읽기 |
users.read | 사용자 데이터 읽기 (expansions용) |