Reddit Subreddit Feed

reddit_subreddit_feed

Fetch a subreddit's new, hot or rising posts by reading the subreddit page itself

Category: reddit•Timeout: 120s• Retryable

Input schema

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

{
  "type": "object",
  "properties": {
    "subreddit": {
      "type": "string",
      "description": "Subreddit name without the r/ prefix (e.g. \"TheMachineLearning\")",
      "pattern": "^[A-Za-z0-9_]{2,21}$",
      "examples": [
        "TheMachineLearning",
        "LocalLLaMA"
      ]
    },
    "sort": {
      "type": "string",
      "enum": [
        "new",
        "hot",
        "rising"
      ],
      "description": "Which feed to read. Defaults to \"new\"."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "description": "How many posts to return (1–100). Defaults to 25."
    },
    "after": {
      "type": "string",
      "pattern": "^t3_[a-z0-9]+$",
      "description": "Start after this post: the `after` of the previous page (e.g. \"t3_1xnrrxy\")"
    }
  },
  "required": [
    "subreddit"
  ]
}

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": {
    "subreddit": {
      "type": "string"
    },
    "sort": {
      "type": "string",
      "enum": [
        "new",
        "hot",
        "rising"
      ]
    },
    "after": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pass as `after` to read the next page; null when the subreddit ran out of posts"
    },
    "posts": {
      "type": "array",
      "description": "The feed's posts, in feed order",
      "items": {
        "$ref": "#/$defs/post"
      }
    },
    "pinned": {
      "type": "array",
      "description": "The subreddit's pinned posts. The page shows them above its feed, not in it.",
      "items": {
        "$ref": "#/$defs/post"
      }
    }
  },
  "required": [
    "subreddit",
    "sort",
    "after",
    "posts",
    "pinned"
  ],
  "$defs": {
    "post": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Post id without the t3_ prefix"
        },
        "fullname": {
          "type": "string",
          "description": "t3_<id>"
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "author": {
          "type": [
            "string",
            "null"
          ]
        },
        "authorId": {
          "type": [
            "string",
            "null"
          ],
          "description": "t2_<id>"
        },
        "subreddit": {
          "type": [
            "string",
            "null"
          ]
        },
        "subredditId": {
          "type": [
            "string",
            "null"
          ],
          "description": "t5_<id>"
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdUtc": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Unix seconds"
        },
        "score": {
          "type": [
            "integer",
            "null"
          ]
        },
        "upvoteRatio": {
          "type": [
            "number",
            "null"
          ],
          "description": "Unrounded, 0–1"
        },
        "commentCount": {
          "type": [
            "integer",
            "null"
          ]
        },
        "awardCount": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Reddit's current awards count shown on the post"
        },
        "permalink": {
          "type": [
            "string",
            "null"
          ]
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Full URL of the post"
        },
        "contentUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "What a link / image / video / gallery / crosspost points at; null for a text post"
        },
        "domain": {
          "type": [
            "string",
            "null"
          ]
        },
        "postType": {
          "type": [
            "string",
            "null"
          ],
          "description": "As Reddit labels the post: text, link, image, gallery, video, gif, poll, multi_media, crosspost, …"
        },
        "language": {
          "type": [
            "string",
            "null"
          ]
        },
        "isSelf": {
          "type": "boolean"
        },
        "isNsfw": {
          "type": "boolean"
        },
        "isSpoiler": {
          "type": "boolean"
        },
        "isStickied": {
          "type": "boolean"
        },
        "isLocked": {
          "type": "boolean"
        },
        "isArchived": {
          "type": "boolean"
        },
        "flair": {
          "type": [
            "string",
            "null"
          ],
          "description": "Post flair, with :emoji: codes"
        },
        "authorFlair": {
          "type": [
            "string",
            "null"
          ],
          "description": "Author flair, with :emoji: codes"
        },
        "distinguished": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "moderator",
            "admin",
            null
          ]
        },
        "body": {
          "type": [
            "string",
            "null"
          ],
          "description": "The text as the page renders it, rebuilt as markdown; null for posts whose card shows no text"
        },
        "thumbnail": {
          "type": [
            "string",
            "null"
          ]
        },
        "media": {
          "type": [
            "object",
            "null"
          ],
          "description": "Whichever the post has: images, gallery (with original sizes), video (hls/mp4 URLs, duration, size), poll (options, total votes, closing time), embed"
        },
        "crosspostParent": {
          "type": [
            "string",
            "null"
          ],
          "description": "t3_<id> of a crosspost's original"
        }
      },
      "required": [
        "id",
        "fullname",
        "isSelf",
        "isNsfw",
        "isSpoiler",
        "isStickied",
        "isLocked",
        "isArchived"
      ]
    }
  }
}

Ready to run Reddit Subreddit Feed?

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

Get started
Tskgone — Distributed Task Scraping Platform