x/timeline
read-only
Recent posts from a profile, or the home timeline when user is omitted.
await page.runPlugin("x/timeline")
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
user | string | Handle (nasa, @nasa) or profile URL; omit for the home timeline. | |
limit | integer1–200 | 20 | Maximum number of posts. |
includeReposts | boolean | false | Keep reposts of other accounts in a profile feed. |
Returns
{
source: "profile" | "home",
user?: string | null,
posts: {
id: string,
url: string,
author: {
name?: string | null,
handle: string
},
text: string,
lang?: string | null,
createdAt: string | null,
context?: string | null,
metrics: {
replies: integer,
reposts: integer,
likes: integer,
views?: integer | null
},
media?: {
type?: "photo" | "video",
url?: string | null
}[],
links?: string[],
quote?: null | {
author: {
name?: string | null,
handle: string
},
text: string,
createdAt?: string | null
}
}[]
}
x/search
read-only
Posts matching a search query (X search operators work).
await page.runPlugin("x/search", { query: "<query>" })
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
queryrequired | stringmin length 1 | Search text, e.g. "from:nasa artemis". | |
tab | "top" | "latest" | "top" | Top or Latest results. |
limit | integer1–200 | 20 | Maximum number of posts. |
Returns
{
query: string,
tab?: string,
posts: {
id: string,
url: string,
author: {
name?: string | null,
handle: string
},
text: string,
lang?: string | null,
createdAt: string | null,
context?: string | null,
metrics: {
replies: integer,
reposts: integer,
likes: integer,
views?: integer | null
},
media?: {
type?: "photo" | "video",
url?: string | null
}[],
links?: string[],
quote?: null | {
author: {
name?: string | null,
handle: string
},
text: string,
createdAt?: string | null
}
}[]
}
x/post
read-only
One post by URL or id, with its first replies.
await page.runPlugin("x/post")
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
url | string | Post URL, e.g. https://x.com/nasa/status/123. | |
id | string/^\d+$/ | Numeric post id (instead of url). | |
replies | integer0–200 | 20 | Number of replies to collect; 0 for none. |
Returns
{
post: {
id: string,
url: string,
author: {
name?: string | null,
handle: string
},
text: string,
lang?: string | null,
createdAt: string | null,
context?: string | null,
metrics: {
replies: integer,
reposts: integer,
likes: integer,
views?: integer | null
},
media?: {
type?: "photo" | "video",
url?: string | null
}[],
links?: string[],
quote?: null | {
author: {
name?: string | null,
handle: string
},
text: string,
createdAt?: string | null
}
},
replies: {
id: string,
url: string,
author: {
name?: string | null,
handle: string
},
text: string,
lang?: string | null,
createdAt: string | null,
context?: string | null,
metrics: {
replies: integer,
reposts: integer,
likes: integer,
views?: integer | null
},
media?: {
type?: "photo" | "video",
url?: string | null
}[],
links?: string[],
quote?: null | {
author: {
name?: string | null,
handle: string
},
text: string,
createdAt?: string | null
}
}[]
}
x/profile
read-only
Profile fields of an account: name, bio, follower counts, join date.
await page.runPlugin("x/profile", { user: "<user>" })
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
userrequired | string | Handle or profile URL. |
Returns
{
handle: string,
name: string | null,
verified?: boolean,
bio: string,
location?: string | null,
website?: string | null,
joined?: string | null,
following?: integer | null,
followers?: integer | null,
url?: string
}