Search Posts
reddit.search_posts
ActionChat & messagingconnection required
Calls the Reddit API with the connection's credentials.
Search posts in one subreddit, or across all of Reddit when no subreddit is given.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- OAuth 2.0
- Providers
- Secret shape
- {"client_id": "…", "client_secret": "…", "refresh_token": "…"}
- Config it needs
- user_agent, subreddit
- Resolved by
- config.connection_id, else node.connection_id
Configuration
8 fields, 1 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
query Search query, in the syntax named by the 'syntax' field. | string | Yes | — | — | postgres migration |
subreddit Subreddit to act on, with or without the 'r/' prefix. Falls back to the connection's default subreddit when left blank. | string | No | — | — | python |
restrict_to_subreddit Limit results to the named subreddit. Ignored for a site-wide search. | boolean | No | true | — | — |
sort How results are ranked: relevance, hot, top, new or comments. | string | No | relevance | one of "relevance", "hot", "top", "new", "comments" | — |
syntax Query syntax Reddit parses the query with. | string | No | lucene | one of "lucene", "cloudsearch", "plain" | — |
time_filter Time window the ranking covers; applies to the 'top' and 'controversial' sorts and to search. | string | No | — | one of "hour", "day", "week", "month", "year", "all" | — |
limit How many items to return in one page. Reddit caps a page at 100. | number | No | 25 | 1–100 | — |
after Pagination cursor: the 'after' value returned by the previous page. | string | No | — | — | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"limit": 25,
"query": "postgres migration",
"restrict_to_subreddit": true,
"sort": "relevance",
"subreddit": "python",
"syntax": "lucene"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
items The things on this page, each unwrapped from its Listing child. | array | — |
count How many things this page returned. | number | — |
after Cursor for the next page, or null on the last page. | string | — |
before Cursor for the previous page, or null on the first page. | string | — |
subreddit The subreddit that was searched ('all' site-wide). | string | — |
{
"after": "",
"before": "",
"count": 0,
"items": [],
"subreddit": ""
}See Search Posts run in a workflow.
In a technical demo we add the Reddit connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.