- 유용한 도구
- 핵심 개념
유용한 도구
Postman
코드 예제
서드파티 라이브러리
핵심 개념
인증
개발자 콘솔, 프로젝트, 개발자 App
요청 한도
코드 예제
북마크 가져오기
cURL
북마크 생성
cURL
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl "https://api.x.com/2/users/123/bookmarks?tweet.fields=created_at,public_metrics" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN"
from xdk import Client
client = Client(bearer_token="YOUR_USER_ACCESS_TOKEN")
# 사용자의 북마크 가져오기
for page in client.bookmarks.get(user_id="123", tweet_fields=["created_at", "public_metrics"]):
for post in page.data:
print(f"{post.text} - 좋아요: {post.public_metrics.like_count}")
import { Client } from "@xdevplatform/xdk";
const client = new Client({ accessToken: "YOUR_USER_ACCESS_TOKEN" });
// 사용자의 북마크 가져오기
const paginator = client.bookmarks.get("123", {
tweetFields: ["created_at", "public_metrics"],
});
for await (const page of paginator) {
page.data?.forEach((post) => {
console.log(`${post.text} - 좋아요: ${post.public_metrics?.like_count}`);
});
}
curl -X POST "https://api.x.com/2/users/123/bookmarks" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"tweet_id": "1234567890"}'
from xdk import Client
client = Client(bearer_token="YOUR_USER_ACCESS_TOKEN")
# 게시물을 북마크합니다
response = client.bookmarks.create(user_id="123", tweet_id="1234567890")
print(response.data)
import { Client } from "@xdevplatform/xdk";
const client = new Client({ accessToken: "YOUR_USER_ACCESS_TOKEN" });
// 게시물을 북마크합니다
const response = await client.bookmarks.create("123", { tweetId: "1234567890" });
console.log(response.data);