reddit/search
read-only
Posts matching a Reddit search, across Reddit or within one subreddit. Search results carry no external link (link is null); use thread for it.
await page.runPlugin("reddit/search", { query: "<query>" })
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
queryrequired | stringmin length 1 | Search text; Reddit operators such as author:, site:, title:, self:yes work. | |
subreddit | stringmin length 1 | Limit to one subreddit: "rust", "r/rust" or its URL. | |
sort | "relevance" | "new" | "top" | "comments" | "hot" | "relevance" | |
time | "hour" | "day" | "week" | "month" | "year" | "all" | Time range; Reddit applies it to relevance, top and comments. | |
limit | integer1–50 | 25 | Maximum number of posts. |
Returns
{
query: string,
subreddit?: string | null,
sort?: string,
time?: string | null,
posts: {
id: string,
subreddit: string,
title: string,
author: string,
score: integer | null,
comments: integer,
created: string,
url: string,
link: string | null,
nsfw?: boolean
}[]
}
reddit/subreddit
read-only
Posts of one subreddit, as its Hot, New, Top or Rising tab lists them (pinned posts included, ads skipped).
await page.runPlugin("reddit/subreddit", { name: "<name>" })
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
namerequired | stringmin length 1 | "rust", "r/rust" or the subreddit URL. | |
sort | "hot" | "new" | "top" | "rising" | "hot" | |
time | "hour" | "day" | "week" | "month" | "year" | "all" | Time range for sort "top" (default day). | |
limit | integer1–100 | 25 | Maximum number of posts. |
Returns
{
subreddit: string,
sort: string,
time?: string | null,
posts: {
id: string,
subreddit: string,
title: string,
author: string,
score: integer | null,
comments: integer,
created: string,
url: string,
link: string | null,
nsfw?: boolean
}[]
}
reddit/thread
read-only
One post with its text and nested comments. "Load more" and "continue this thread" stubs are skipped and counted in omitted.
await page.runPlugin("reddit/thread")
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
url | string | Post or comment URL on reddit.com (www, old, new), a redd.it link, or a /r/<name>/s/<code> share link. | |
id | string/^(t3_)?[a-z0-9]{1,13}$/ | Post id such as "1y7in56" (instead of url). | |
limit | integer0–500 | 50 | Maximum number of comments, counted across all levels; 0 for the post only. |
depth | integer1–10 | 3 | Reply levels to include; 1 for top-level comments only. |
sort | "best" | "top" | "new" | "controversial" | "old" | "qa" | "best" | Comment order. |
Returns
{
post: {
id: string,
subreddit: string,
title: string,
author: string,
score: integer | null,
comments: integer,
created: string,
url: string,
link: string | null,
nsfw?: boolean,
selftext: string,
locked?: boolean,
removed?: boolean
},
comments: {
id: string,
author: string,
score: integer | null,
created: string,
text: string,
op?: boolean,
stickied?: boolean,
replies: {
id: string,
author: string,
score: integer | null,
created: string,
text: string,
op?: boolean,
stickied?: boolean,
replies: …[]
}[]
}[],
omitted: {
comments: integer,
stubs: integer
}
}