Top posts
The Creator hub's "Inspiration" surface (x.com/i/jf/creators/inspiration/top_posts) is a global top-posts leaderboard: the most-engaged public posts, filterable by engagement metric, time window and country. It is the one Jetfuel feed that resolves to real tweets, so emusks gives it a proper helper.
jetfuel.topPosts(opts?)
Fetches the leaderboard as parsed tweets. Returns the standard timeline shape: { tweets, users, nextCursor, previousCursor, raw }, plus the echoed engagement, period, country and the resolved timelineId.
| Option | Type | Description |
|---|---|---|
engagement | string | Metric to rank by. Default "Likes". See engagements. |
period | string | "Daily" (default), "Weekly" or "Monthly" |
country | string | ISO 3166 alpha-3 country code, or "All" (default) for the global board |
count | number | Page size. Default 20. |
cursor | string | nextCursor from the previous page |
viaRemote | boolean | Get the timeline token from the binary feed instead of building it locally. Costs an extra request. Default false. |
raw | boolean | Return the unparsed GenericTimelineById response |
// most-liked posts in the US today
const { tweets } = await client.jetfuel.topPosts({
engagement: "Likes",
period: "Daily",
country: "USA",
});
// most-replied globally this week, then paginate
const first = await client.jetfuel.topPosts({ engagement: "Replies", period: "Weekly" });
const next = await client.jetfuel.topPosts({
engagement: "Replies",
period: "Weekly",
cursor: first.nextCursor,
});By default topPosts builds the timeline token locally and resolves it, with no extra request. The token is deterministic, so it matches what the live UI fetches. viaRemote: true asks the server for the token instead, which helps as a sanity check or if Twitter changes the token format.
Engagements
emusks throws on any engagement or period not listed here.
| Value | UI label |
|---|---|
Likes | Most Likes |
Replies | Most Replies |
Bookmarks | Most Bookmarks |
Quotes | Most Quotes |
VideoQualityViews | Most Video Views |
Country codes aren't checked. The ones Twitter's UI offers are All, USA, CAN, GBR, AUS, DEU, FRA, JPN, BRA, IND, MEX, ESP, ITA, KOR, NLD, ARG, POL, TUR, IDN, SAU, ZAF, NGA, PHL, THA, VNM, EGY, PAK, MYS, SGP, ARE, COL, CHL, SWE, NOR, DNK, FIN, BEL, AUT, CHE, PRT, GRC, IRL, NZL, ISR, RUS, UKR, CZE, ROU and HUN.
jetfuel.topPostsTimelineId(opts?)
Builds the GenericTimelineById token for a leaderboard query offline, with no network call. It takes the same engagement, period and country options as topPosts and returns the same token the feed does.
const id = client.jetfuel.topPostsTimelineId({ engagement: "Quotes", country: "BRA", period: "Monthly" });
// "VGltZWxpbmU6DADKCwABAAAABlF1b3Rlcw..."
// resolve it yourself, e.g. with extra GraphQL variables
const raw = await client.graphql("GenericTimelineById", { variables: { timelineId: id, count: 40 } });jetfuel.topPostsFeed(opts?)
Fetches the binary inspiration feed (creators/inspiration/remote/urt) and returns what it contains: the embedded timeline token, its decoded parameters and the whole decoded payload. Takes engagement, period and country.
| Field | Description |
|---|---|
token | The base64 Timeline: token (feed into GenericTimelineById). |
params | { engagement, country, period } decoded from the token. |
decoded | The whole decoded payload (see wire format). |
status | HTTP status. |
const feed = await client.jetfuel.topPostsFeed({ engagement: "Likes", period: "Daily", country: "PRT" });
feed.token; // "VGltZWxpbmU6DADK..."
feed.params; // { engagement: "Likes", country: "PRT", period: "Daily" }jetfuel.inspirationPage(opts?)
Fetches and decodes the leaderboard page itself, the UI with the country and language dropdowns and the engagement tabs, not the posts. Use it to read the list of countries and languages Twitter offers.
const page = await client.jetfuel.inspirationPage();
page.strings.filter((s) => s.length > 2); // "United States", "Canada", "Brazil", ...