{
  "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": "2.0",
    "x-build-id": "ewyJ3io13Qsg6f124"
  },
  "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",
        "properties": {
          "mode": {
            "title": "What to collect",
            "enum": [
              "subredditPosts",
              "subredditComments",
              "postComments",
              "postsByIds",
              "subredditSearch",
              "subredditRules"
            ],
            "type": "string",
            "description": "Pick the record type: posts from subreddits, comments from subreddits, the comment tree of specific posts, specific posts by ID, subreddit discovery, or subreddit rules.",
            "default": "subredditPosts"
          },
          "subreddits": {
            "title": "Subreddits",
            "minItems": 1,
            "type": "array",
            "description": "Subreddit names to collect from. Accepts bare names (python), r/ prefixed names (r/python) or full URLs (https://www.reddit.com/r/python/). Used by the post, comment, rules, subreddit-search and rules-included search modes.",
            "items": {
              "type": "string"
            }
          },
          "postIds": {
            "title": "Post IDs or URLs",
            "type": "array",
            "description": "Specific posts to collect. Accepts bare IDs (1xv3n8h), t3_-prefixed IDs or full Reddit post URLs. Required for 'Comment trees for specific posts' and 'Specific posts by ID'.",
            "items": {
              "type": "string"
            }
          },
          "subredditQuery": {
            "title": "Subreddit name starts with",
            "type": "string",
            "description": "Prefix used to discover subreddits in 'Search subreddits' mode (for example 'ask' finds r/askreddit). Leave empty to look up the exact names in 'Subreddits' instead."
          },
          "includeRules": {
            "title": "Include rules for found subreddits",
            "type": "boolean",
            "description": "When searching subreddits, also emit each found subreddit's moderation rules as separate records. Only used in 'Search subreddits' mode.",
            "default": false
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "new",
              "old",
              "hot",
              "top",
              "rising",
              "controversial",
              "best"
            ],
            "type": "string",
            "description": "Ordering for posts or comments. 'new'/'old' use the source's chronological order; 'top', 'hot', 'rising', 'controversial' and 'best' are ranked over the selected time window after collection.",
            "default": "new"
          },
          "timeFilter": {
            "title": "Ranking time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "How far back to look when ranking posts or comments by hot, top, rising, controversial or best. Ignored for newest-first and oldest-first collection.",
            "default": "day"
          },
          "maxPosts": {
            "title": "Maximum posts per subreddit",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of matching posts to keep from each subreddit. The actor pages through Arctic Shift until it has this many matches or the source is exhausted.",
            "default": 25
          },
          "maxItems": {
            "title": "Maximum total items",
            "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
          },
          "fullSubreddit": {
            "title": "Walk the whole reachable history",
            "type": "boolean",
            "description": "Keep paging past the usual safety window until the subreddit's archived history is exhausted or 'Maximum posts per subreddit' is reached. Combine with a higher post limit for deep backfills.",
            "default": false
          },
          "includeComments": {
            "title": "Include comment trees for each post",
            "type": "boolean",
            "description": "When collecting subreddit posts, also fetch each post's nested comment tree from Arctic Shift.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Maximum comments per post",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum comments to keep for each post. In 'Comment trees for specific posts' mode this defaults to 100 when left at 0; in post mode comments are collected only when 'Include comment trees' is on.",
            "default": 0
          },
          "commentSort": {
            "title": "Comment order inside each tree",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Ordering of sibling comments inside each comment tree. Confidence, top and Q&A rank by score; new and old rank by time; controversial ranks by the source's controversy flag.",
            "default": "confidence"
          },
          "postedAfter": {
            "title": "Created on or after (YYYY-MM-DD)",
            "type": "string",
            "description": "Only keep posts or comments created on or after this date (UTC)."
          },
          "postedBefore": {
            "title": "Created on or before (YYYY-MM-DD)",
            "type": "string",
            "description": "Only keep posts or comments 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, comments and subreddits flagged as NSFW/18+.",
            "default": false
          },
          "onlyWithFlair": {
            "title": "Only posts that have a flair",
            "type": "boolean",
            "description": "Drop posts without a link flair.",
            "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. Leave unset to keep all types. Legacy 'self' is treated as 'text'."
          },
          "minScore": {
            "title": "Minimum score",
            "minimum": -1000000,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep posts/comments with a score at or above this value. Scores are provisional (often 1) for the first ~36 hours after posting."
          },
          "maxScore": {
            "title": "Maximum score",
            "minimum": -1000000,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep posts/comments with a score at or below this value. Useful for finding overlooked items."
          },
          "minComments": {
            "title": "Minimum comment count",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep posts with at least this many comments. Comment counts are provisional for the first ~36 hours."
          },
          "maxComments": {
            "title": "Maximum comment count",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep posts with at most this many comments."
          },
          "minUpvoteRatio": {
            "title": "Minimum upvote ratio",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Keep posts whose upvote ratio (0-1) is at or above this value."
          },
          "excludeStickied": {
            "title": "Exclude stickied posts",
            "type": "boolean",
            "description": "Drop posts pinned by moderators.",
            "default": false
          },
          "excludeCrossposts": {
            "title": "Exclude crossposts",
            "type": "boolean",
            "description": "Drop posts that crosspost another submission.",
            "default": false
          },
          "excludeSpoilers": {
            "title": "Exclude spoiler posts",
            "type": "boolean",
            "description": "Drop posts marked as spoilers.",
            "default": false
          },
          "excludeArchived": {
            "title": "Exclude archived posts",
            "type": "boolean",
            "description": "Drop archived posts that can no longer receive votes or comments.",
            "default": false
          },
          "excludeLocked": {
            "title": "Exclude locked posts",
            "type": "boolean",
            "description": "Drop posts whose comment threads are locked.",
            "default": false
          },
          "excludeRemoved": {
            "title": "Exclude removed posts",
            "type": "boolean",
            "description": "Drop posts removed by moderators or Reddit (removed_by_category is present).",
            "default": false
          },
          "onlyOriginalContent": {
            "title": "Only original-content posts",
            "type": "boolean",
            "description": "Keep only posts carrying Reddit's original-content marker.",
            "default": false
          },
          "distinguished": {
            "title": "Moderator/admin badge",
            "enum": [
              "any",
              "moderator",
              "admin",
              "special"
            ],
            "type": "string",
            "description": "Keep only posts or comments distinguished as moderator, admin or special. Use 'Any' to keep all.",
            "default": "any"
          },
          "titleContains": {
            "title": "Title contains keyword",
            "type": "string",
            "description": "Keep posts whose title contains this text (case-insensitive)."
          },
          "contentContains": {
            "title": "Post body contains keyword",
            "type": "string",
            "description": "Keep posts whose self-text contains this text (case-insensitive). Link/image/video posts have no body and are excluded when this is set."
          },
          "searchQuery": {
            "title": "Keyword (title + body)",
            "type": "string",
            "description": "Keep posts whose title or self-text contains this text, or comments whose body contains it (case-insensitive). Applied after download so it never triggers an Arctic Shift query timeout."
          },
          "flairContains": {
            "title": "Flair contains keyword",
            "type": "string",
            "description": "Keep posts whose link flair contains this text (case-insensitive)."
          },
          "authorFlairContains": {
            "title": "Author flair contains keyword",
            "type": "string",
            "description": "Keep posts or comments whose author flair contains this text (case-insensitive)."
          },
          "urlContains": {
            "title": "Link URL contains",
            "type": "string",
            "description": "Keep posts whose link target or permalink contains this text (case-insensitive)."
          },
          "authors": {
            "title": "Only these authors",
            "type": "array",
            "description": "Keep records by one of these usernames (bare or u/-prefixed, case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "excludeAuthors": {
            "title": "Exclude these authors",
            "type": "array",
            "description": "Drop records by these usernames (bare or u/-prefixed, case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop records whose title, body or flair contains any of these keywords (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "domain": {
            "title": "Domain contains",
            "type": "string",
            "description": "Keep posts whose link domain contains this text (case-insensitive), for example youtube.com or self.python."
          },
          "minAwards": {
            "title": "Minimum awards",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep posts with at least this many total awards."
          },
          "excludeDeletedAuthor": {
            "title": "Exclude deleted/removed authors",
            "type": "boolean",
            "description": "Drop records whose author account was deleted or removed.",
            "default": false
          },
          "minContentLength": {
            "title": "Minimum body length (characters)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep self-text posts with at least this many characters. Link/image/video posts have no body and are excluded when this is set."
          },
          "maxContentLength": {
            "title": "Maximum body length (characters)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep self-text posts with at most this many characters."
          },
          "subredditSort": {
            "title": "Subreddit search order",
            "enum": [
              "subscribers",
              "name",
              "created"
            ],
            "type": "string",
            "description": "Ordering for 'Search subreddits' results. Name order is alphabetical; subscribers and created are largest/newest first.",
            "default": "subscribers"
          },
          "minSubscribers": {
            "title": "Minimum subscribers",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Only return subreddits with at least this many subscribers."
          },
          "maxSubscribers": {
            "title": "Maximum subscribers",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Only return subreddits with at most this many subscribers."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}