Reddit Search Posts

reddit_search_posts

Search Reddit posts by reading the search page, each result returned exactly as Reddit's post JSON has it

Category: reddit•Timeout: 300s• Retryable

Input schema

POST this shape to /api/v1/tasks as the input field when creating a task in a group of type reddit_search_posts.

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512,
      "description": "What to search for, with Reddit's own search syntax (\"water filter\", author:\"name\", subreddit:x, …)"
    },
    "sort": {
      "type": "string",
      "enum": [
        "relevance",
        "hot",
        "top",
        "new",
        "comments"
      ],
      "description": "Result order. Defaults to \"relevance\"."
    },
    "timeframe": {
      "type": "string",
      "enum": [
        "hour",
        "day",
        "week",
        "month",
        "year",
        "all"
      ],
      "description": "Only posts from this far back. Defaults to \"all\"."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "description": "How many posts to return (1–100). Defaults to 25."
    },
    "subreddit": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_]{2,21}$",
      "description": "Search inside this subreddit only (without the r/ prefix)"
    },
    "after": {
      "type": "string",
      "pattern": "^t3_[a-z0-9]+$",
      "description": "Start after this post: the `after` of the previous page"
    }
  },
  "required": [
    "query"
  ]
}

Output schema

Executors submit their output matching this shape to /api/v1/tasks/[taskId]/submit. Readers pull it back from task detail endpoints.

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "sort": {
      "type": "string"
    },
    "timeframe": {
      "type": "string"
    },
    "subreddit": {
      "type": [
        "string",
        "null"
      ]
    },
    "after": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pass as `after` to read the next page; null when the search ran out of results"
    },
    "posts": {
      "type": "array",
      "description": "The results in the search's order, each Reddit's own post object (the `data` of a t3, as `raw_json=1` returns it)",
      "items": {
        "type": "object"
      }
    }
  },
  "required": [
    "query",
    "sort",
    "timeframe",
    "subreddit",
    "after",
    "posts"
  ]
}

Ready to run Reddit Search Posts?

Create a project, approve an executor, and push your first reddit_search_posts task.

Get started
Tskgone — Distributed Task Scraping Platform