← All plugins

X

Read posts, searches, threads and profiles on x.com using the signed-in browser session.

x v1.0.6 4 commands

x/timeline

read-only

Recent posts from a profile, or the home timeline when user is omitted.

await page.runPlugin("x/timeline")

Arguments

NameTypeDefaultDescription
userstringHandle (nasa, @nasa) or profile URL; omit for the home timeline.
limitinteger
1–200
20Maximum number of posts.
includeRepostsbooleanfalseKeep 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/post

read-only

One post by URL or id, with its first replies.

await page.runPlugin("x/post")

Arguments

NameTypeDefaultDescription
urlstringPost URL, e.g. https://x.com/nasa/status/123.
idstring
/^\d+$/
Numeric post id (instead of url).
repliesinteger
0–200
20Number 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

NameTypeDefaultDescription
userrequiredstringHandle 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
}