{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Subreddit Post & Comment Harvester",
    "description": "Pull posts from any subreddit with score, media, flairs, awards and moderation flags, plus optional nested comment threads. Filter by date, score, keyword, author, post type and more. No API key or login.",
    "version": "1.0",
    "x-build-id": "qdSuwLoNAqkhDc3y4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vexaloom-labs~reddit-subreddit-post-and-comment-harvester/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vexaloom-labs-reddit-subreddit-post-and-comment-harvester",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/vexaloom-labs~reddit-subreddit-post-and-comment-harvester/runs": {
      "post": {
        "operationId": "runs-sync-vexaloom-labs-reddit-subreddit-post-and-comment-harvester",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/vexaloom-labs~reddit-subreddit-post-and-comment-harvester/run-sync": {
      "post": {
        "operationId": "run-sync-vexaloom-labs-reddit-subreddit-post-and-comment-harvester",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "subreddits"
        ],
        "properties": {
          "subreddits": {
            "title": "Subreddits",
            "minItems": 1,
            "type": "array",
            "description": "List of subreddits to scrape. Accepts bare names (python), r/ prefixed (r/python) or full URLs (https://www.reddit.com/r/python/).",
            "items": {
              "type": "string"
            }
          },
          "maxPosts": {
            "title": "Maximum posts per subreddit",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of posts to keep from each subreddit after filters. Reddit serves roughly 1,000 posts per hot/new listing and about 500 for top/controversial.",
            "default": 25
          },
          "maxItems": {
            "title": "Maximum total items (safety cap)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Global safety cap on the total number of records pushed for the whole run (posts and comments combined).",
            "default": 10000
          },
          "sort": {
            "title": "Sort posts by",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial",
              "best"
            ],
            "type": "string",
            "description": "How to sort posts in the subreddit. Reddit serves roughly 1,000 posts per hot/new listing and about 500 for top/controversial.",
            "default": "new"
          },
          "timeFilter": {
            "title": "Time filter (for 'top' and 'controversial' sort)",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time filter when sorting by 'top' or 'controversial'.",
            "default": "day"
          },
          "includeComments": {
            "title": "Include comments for each post",
            "type": "boolean",
            "description": "When enabled, the full comment thread (including nested replies) is collected for every scraped post. Significantly increases run time and output.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Maximum comments per post",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of comments to scrape per post (only used when 'Include comments' is enabled).",
            "default": 0
          },
          "commentSort": {
            "title": "Sort comments by",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "How to sort the comment threads.",
            "default": "confidence"
          },
          "postedAfter": {
            "title": "Posts created on or after (YYYY-MM-DD)",
            "type": "string",
            "description": "Only keep posts created on or after this date (UTC). When set, collection runs newest-first (sort=new) and the sort option above is ignored. Reddit caps each listing at roughly 1,000 posts, so a distant date window on a very active subreddit may not be fully reachable."
          },
          "postedBefore": {
            "title": "Posts created on or before (YYYY-MM-DD)",
            "type": "string",
            "description": "Only keep posts created on or before this date (interpreted as the end of that day, UTC)."
          },
          "includeNSFW": {
            "title": "Include NSFW (18+) content",
            "type": "boolean",
            "description": "Include posts Reddit explicitly flags as NSFW. Posts in 18+ communities are served by the actor's adult-content cookie and are not distinguishable at community level.",
            "default": false
          },
          "onlyWithFlair": {
            "title": "Only posts that have a flair",
            "type": "boolean",
            "description": "When enabled, posts without a flair tag are dropped from the results.",
            "default": false
          },
          "postType": {
            "title": "Only posts of this type",
            "enum": [
              "text",
              "link",
              "image",
              "video",
              "gallery",
              "poll",
              "crosspost",
              "multi_media"
            ],
            "type": "string",
            "description": "Keep only posts of the selected content type (based on Reddit's listing type). Leave unset to keep all types. Legacy 'self' is treated as 'text'."
          },
          "minScore": {
            "title": "Minimum score (upvotes minus downvotes)",
            "minimum": -100000,
            "maximum": 1000000,
            "type": "integer",
            "description": "Only keep posts with a score at or above this value. Leave unset to keep all scores."
          },
          "maxScore": {
            "title": "Maximum score (upvotes minus downvotes)",
            "minimum": -100000,
            "maximum": 1000000,
            "type": "integer",
            "description": "Only keep posts with a score at or below this value. Useful for finding overlooked/low-visibility posts. Leave unset to keep all scores."
          },
          "minComments": {
            "title": "Minimum number of comments",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Only keep posts with at least this many comments. Leave unset to keep all posts."
          },
          "maxComments": {
            "title": "Maximum number of comments",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Only keep posts with at most this many comments. Useful for finding under-discussed posts. Leave unset to keep all posts."
          },
          "excludeStickied": {
            "title": "Exclude stickied/pinned posts",
            "type": "boolean",
            "description": "When enabled, posts pinned/stickied by moderators (e.g. rules, weekly threads) are dropped from the results.",
            "default": false
          },
          "minUpvoteRatio": {
            "title": "Minimum upvote ratio",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Only keep posts whose upvote ratio (fraction of votes that are upvotes, 0-1) is at or above this value. Useful for filtering out controversial/divisive posts. Leave unset to keep all ratios."
          },
          "excludeCrossposts": {
            "title": "Exclude crossposts",
            "type": "boolean",
            "description": "When enabled, posts that are crossposts from another subreddit are dropped from the results, keeping only original submissions to the scraped subreddit.",
            "default": false
          },
          "excludeSpoilers": {
            "title": "Exclude spoiler-tagged posts",
            "type": "boolean",
            "description": "When enabled, posts marked as a spoiler by their author are dropped from the results.",
            "default": false
          },
          "titleContains": {
            "title": "Title contains keyword",
            "type": "string",
            "description": "Only keep posts whose title contains this text (case-insensitive substring match). Leave empty to keep all titles."
          },
          "contentContains": {
            "title": "Post text contains keyword",
            "type": "string",
            "description": "Only keep self (text) posts whose body contains this text (case-insensitive substring match). Link/image/video posts have no body text and are excluded when this is set. Leave empty to keep all posts."
          },
          "flairContains": {
            "title": "Flair contains keyword",
            "type": "string",
            "description": "Only keep posts whose flair text contains this text (case-insensitive substring match). Leave empty to keep all flairs."
          },
          "authors": {
            "title": "Only posts by these authors",
            "type": "array",
            "description": "Only keep posts submitted by one of these usernames (bare name or u/-prefixed, case-insensitive). Leave empty to keep posts from all authors.",
            "items": {
              "type": "string"
            }
          },
          "domain": {
            "title": "Domain contains",
            "type": "string",
            "description": "Only keep posts whose link domain contains this text (case-insensitive, e.g. 'youtube.com' or 'self.python'). Leave empty to keep all domains."
          },
          "minAwards": {
            "title": "Minimum awards received",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Only keep posts with at least this many total awards. Leave unset to keep all posts."
          },
          "excludeDeletedAuthor": {
            "title": "Exclude posts with a deleted/removed author",
            "type": "boolean",
            "description": "When enabled, posts whose author account was deleted (shown as [deleted]/[removed]) are dropped from the results.",
            "default": false
          },
          "excludeAuthors": {
            "title": "Exclude posts by these authors",
            "type": "array",
            "description": "Drop posts submitted by any of these usernames (bare name or u/-prefixed, case-insensitive) — useful for filtering out bots (e.g. AutoModerator) or known spam accounts. Leave empty to keep posts from all authors.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop posts whose title, self-text body or flair contains any of these keywords or phrases (case-insensitive substring match) — useful for filtering out megathreads, giveaways or spam boilerplate. Leave empty to keep all posts.",
            "items": {
              "type": "string"
            }
          },
          "minContentLength": {
            "title": "Minimum post body length (characters)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Only keep self (text) posts whose body is at least this many characters long. Link/image/video posts have no body and are excluded when this is set. Useful for dropping one-line/low-effort text posts when building NLP datasets. Leave unset to keep all lengths."
          },
          "maxContentLength": {
            "title": "Maximum post body length (characters)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Only keep self (text) posts whose body is at most this many characters long. Leave unset to keep all lengths."
          },
          "fullSubreddit": {
            "title": "Full subreddit mode (deepest reachable history)",
            "type": "boolean",
            "description": "When enabled, walk Reddit's 'new' listing as deep as the source allows (roughly 1,000 posts per listing) instead of stopping at the first page. Combine with a higher 'Maximum posts per subreddit'.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}