{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments & 20 Filters",
    "description": "Reads Reddit posts from subreddits, users, searches or post URLs, with comment threads as an option. Filters cover sort, time range, minimum score and comments, flair, domain and NSFW. 41 fields per post: title, text, author, score, upvote ratio, comments, awards, flair, media, crossposts and edits.",
    "version": "1.0",
    "x-build-id": "i2MT90JQa3XVQO6yz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parseforge~reddit-posts-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parseforge-reddit-posts-comments-scraper",
        "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/parseforge~reddit-posts-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parseforge-reddit-posts-comments-scraper",
        "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/parseforge~reddit-posts-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parseforge-reddit-posts-comments-scraper",
        "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": "🎯 Scraping Mode",
            "enum": [
              "subreddit",
              "search",
              "user",
              "multi",
              "comments"
            ],
            "type": "string",
            "description": "Choose how to scrape Reddit:\n\n- subreddit: Fetch posts from a single subreddit\n- search: Search across all of Reddit\n- user: Fetch posts by a specific user\n- multi: Fetch from multiple subreddits at once\n- comments: Fetch all comments from a specific post",
            "default": "subreddit"
          },
          "maxItems": {
            "title": "Maximum posts and comments",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of posts and comments to collect per run."
          },
          "subreddit": {
            "title": "📱 Subreddit",
            "type": "string",
            "description": "Subreddit name without the r/ prefix.\n\nExamples: technology, AskReddit, worldnews, programming"
          },
          "subreddits": {
            "title": "📋 Subreddits List (Multi Mode)",
            "type": "string",
            "description": "Comma-separated list of subreddits for multi mode.\n\nExample: javascript, typescript, webdev, programming"
          },
          "searchQuery": {
            "title": "Search term for posts",
            "type": "string",
            "description": "Search query to find Reddit posts. Used in search mode.\n\nExamples: web scraping, machine learning, best tools 2026"
          },
          "searchInSubreddit": {
            "title": "📍 Search Within Subreddit",
            "type": "string",
            "description": "Restrict search to a specific subreddit. Leave empty to search all of Reddit."
          },
          "username": {
            "title": "👤 Username",
            "type": "string",
            "description": "Reddit username without the u/ prefix.\n\nExample: spez, AutoModerator"
          },
          "postUrl": {
            "title": "🔗 Post URL",
            "type": "string",
            "description": "Full Reddit post URL for comments mode. The post ID will be extracted automatically.\n\nExample: https://www.reddit.com/r/technology/comments/abc123/post_title/"
          },
          "postId": {
            "title": "🆔 Post ID",
            "type": "string",
            "description": "Reddit post ID as an alternative to Post URL.\n\nExample: abc123"
          },
          "sort": {
            "title": "🔄 Sort By",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "How to sort posts:\n\n- hot: Currently popular posts\n- new: Most recent posts\n- top: Highest scored posts (use with Time Range)\n- rising: Posts gaining momentum\n- controversial: Most debated posts\n- relevance: Best match (search only)\n- comments: Most commented",
            "default": "hot"
          },
          "timeRange": {
            "title": "⏰ Time Range",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time range for top and controversial sort orders.",
            "default": "day"
          },
          "commentSort": {
            "title": "💬 Comment Sort",
            "enum": [
              "best",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Sort order for comments when using comments mode or Include Comments.",
            "default": "top"
          },
          "postType": {
            "title": "📝 Post Type Filter",
            "enum": [
              "all",
              "link",
              "self",
              "image",
              "video"
            ],
            "type": "string",
            "description": "Filter posts by type:\n\n- all: All post types\n- self: Text posts only\n- link: Link posts only\n- image: Image posts only\n- video: Video posts only",
            "default": "all"
          },
          "minScore": {
            "title": "⬆️ Minimum Score",
            "minimum": 0,
            "type": "integer",
            "description": "Only include posts with at least this many upvotes. Leave empty for no minimum."
          },
          "minComments": {
            "title": "💬 Minimum Comments",
            "minimum": 0,
            "type": "integer",
            "description": "Only include posts with at least this many comments. Leave empty for no minimum."
          },
          "flairFilter": {
            "title": "🏷️ Flair Filter",
            "type": "string",
            "description": "Only include posts with this exact flair text.\n\nExamples: Discussion, News, Tutorial, Question"
          },
          "domainFilter": {
            "title": "🌐 Domain Filter",
            "type": "string",
            "description": "Only include posts linking to this domain.\n\nExamples: youtube.com, github.com, imgur.com"
          },
          "includeNsfw": {
            "title": "🔞 Include NSFW Posts",
            "type": "boolean",
            "description": "Include posts marked as NSFW (Not Safe For Work / 18+)",
            "default": false
          },
          "includeComments": {
            "title": "💬 Include Comments",
            "type": "boolean",
            "description": "Fetch top comments for each post. Each post requires a separate API request. Uses proxy rotation to avoid Reddit rate limits.",
            "default": false
          },
          "commentsPerPost": {
            "title": "🔢 Comments Per Post",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of comments to fetch per post when Include Comments is enabled.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}