from xdk import Clientclient = Client(bearer_token="YOUR_BEARER_TOKEN")# Get Posts from a List with paginationfor page in client.lists.get_tweets( "84839422", tweet_fields=["created_at", "public_metrics", "author_id"], expansions=["author_id"], user_fields=["username", "verified"], max_results=10): for post in page.data: print(f"{post.text[:50]}... - Likes: {post.public_metrics.like_count}")
import { Client } from "@xdevplatform/xdk";const client = new Client({ bearerToken: "YOUR_BEARER_TOKEN" });// Get Posts from a List with paginationconst paginator = client.lists.getTweets("84839422", { tweetFields: ["created_at", "public_metrics", "author_id"], expansions: ["author_id"], userFields: ["username", "verified"], maxResults: 10,});for await (const page of paginator) { page.data?.forEach((post) => { console.log(`${post.text?.slice(0, 50)}... - Likes: ${post.public_metrics?.like_count}`); });}