{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments & Users",
    "description": "Extract posts, comments, communities & user profiles from any subreddit at scale. Fetches all comments including hidden/collapsed ones. Breaks Reddit's 1000-post limit with date windowing. No login needed, no browser. $0.003 per result. Supports search, sorting, NSFW filtering & date filtering.",
    "version": "1.1",
    "x-build-id": "bOzF7mPeVtnI7dhoh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/betterdevsscrape~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-betterdevsscrape-reddit-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/betterdevsscrape~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-betterdevsscrape-reddit-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/betterdevsscrape~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-betterdevsscrape-reddit-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",
        "required": [
          "proxy"
        ],
        "properties": {
          "startUrls": {
            "title": "🔗 Start URLs",
            "type": "array",
            "description": "Reddit URLs to scrape. Supports post URLs, subreddit URLs, user profile URLs, and leaderboard URLs. Remove all URLs if using the search field instead.\n\nExamples:\n- https://www.reddit.com/r/technology/\n- https://www.reddit.com/r/AskReddit/comments/abc123/some_post/\n- https://www.reddit.com/user/spez/",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "subreddits": {
            "title": "📱 Subreddits",
            "type": "array",
            "description": "List of subreddits to scrape (without r/ prefix). Simpler than Start URLs — just type the name.\n\nExamples: programming, javascript, datascience, AskReddit",
            "items": {
              "type": "string"
            }
          },
          "searches": {
            "title": "🔍 Search queries",
            "type": "array",
            "description": "Search terms to find Reddit content. Each query runs a separate search. Works alongside or instead of Start URLs.\n\nExamples: web scraping, machine learning, best programming language 2026",
            "items": {
              "type": "string"
            }
          },
          "searchCommunityName": {
            "title": "📍 Limit search to community",
            "type": "string",
            "description": "Restrict search results to a specific subreddit (without r/ prefix). Leave empty to search all of Reddit.\n\nExamples: programming, AskReddit, technology"
          },
          "searchPosts": {
            "title": "📝 Search for posts",
            "type": "boolean",
            "description": "Include posts (links, text posts, images) in search results.\n\nDefault: enabled",
            "default": true
          },
          "searchComments": {
            "title": "💬 Search for comments",
            "type": "boolean",
            "description": "Include individual comments in search results. Useful for finding specific discussions.\n\nDefault: disabled",
            "default": false
          },
          "searchCommunities": {
            "title": "🏨️ Search for communities",
            "type": "boolean",
            "description": "Include subreddits/communities in search results. Great for discovering relevant communities.\n\nDefault: disabled",
            "default": false
          },
          "searchUsers": {
            "title": "👤 Search for users",
            "type": "boolean",
            "description": "Include user profiles in search results.\n\nDefault: disabled",
            "default": false
          },
          "maxItems": {
            "title": "📊 Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum total items (posts + comments + communities + users) saved to the dataset. Each item costs $0.003. Start small to estimate costs, then scale up.\n\nExamples: 50, 100, 500, 1000",
            "default": 50
          },
          "maxPostCount": {
            "title": "📄 Max posts per subreddit",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of posts to scrape from each subreddit or search result page. Reddit's API returns up to ~1000 posts per subreddit (use date windowing to break this limit).\n\nExamples: 10, 25, 50, 100, 1000",
            "default": 25
          },
          "postsPerSource": {
            "title": "📝 Posts Per Source",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum posts to scrape from EACH subreddit or search query independently. Useful when scraping multiple subreddits and you want equal coverage. Leave at 0 to use 'Max posts per subreddit' for all sources.\n\nExamples: 25, 50, 100",
            "default": 0
          },
          "maxComments": {
            "title": "💬 Max comments per post",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum comments to extract per post. The scraper automatically fetches collapsed/hidden comments beyond Reddit's initial ~500. Set to 0 to skip comments entirely.\n\nExamples: 0 (no comments), 10, 50, 100, 500",
            "default": 10
          },
          "maxCommunitiesCount": {
            "title": "🏨️ Max community pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of community listing pages to process.\n\nExamples: 1, 2, 5",
            "default": 2
          },
          "maxUserCount": {
            "title": "👤 Max user pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of user listing pages to process.\n\nExamples: 1, 2, 5",
            "default": 2
          },
          "maxLeaderBoardItems": {
            "title": "🏆 Max leaderboard subreddits",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum subreddits to scrape from the popular subreddits leaderboard.\n\nExamples: 5, 10, 25",
            "default": 5
          },
          "sort": {
            "title": "🔄 Sort order",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "rising",
              "comments"
            ],
            "type": "string",
            "description": "How to sort posts and search results.\n\n• **hot** — Trending posts right now (default)\n• **new** — Most recent posts first\n• **top** — Highest-scoring posts (combine with Time filter)\n• **rising** — Posts gaining traction quickly\n• **relevance** — Best match for search queries\n• **comments** — Most-commented posts first",
            "default": "hot"
          },
          "time": {
            "title": "⏰ Time filter",
            "enum": [
              "all",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Filter posts by time period. Only applies when sort is 'top' or 'controversial'.\n\n• **all** — All time (default)\n• **hour** — Past hour\n• **day** — Past 24 hours\n• **week** — Past 7 days\n• **month** — Past 30 days\n• **year** — Past 365 days",
            "default": "all"
          },
          "commentSort": {
            "title": "💬 Comment sort order",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "How to sort comments within posts.\n\n• **confidence** — Reddit's 'Best' sort (default) — balances score and recency\n• **top** — Highest-scoring comments first\n• **new** — Most recent comments first\n• **controversial** — Most debated comments first\n• **old** — Oldest comments first\n• **qa** — Q&A mode (OP responses prioritized)",
            "default": "confidence"
          },
          "minScore": {
            "title": "⬆️ Minimum Score",
            "type": "integer",
            "description": "Only include posts with at least this many upvotes. Leave empty for no minimum.\n\nExamples: 10, 100, 1000"
          },
          "maxScore": {
            "title": "⬇️ Maximum Score",
            "type": "integer",
            "description": "Only include posts with at most this many upvotes. Leave empty for no maximum.\n\nExamples: 100, 500, 10000"
          },
          "minComments": {
            "title": "💬 Minimum Comments",
            "type": "integer",
            "description": "Only include posts with at least this many comments. Leave empty for no minimum.\n\nExamples: 5, 50, 100"
          },
          "maxCommentsFilter": {
            "title": "💬 Maximum Comments",
            "type": "integer",
            "description": "Only include posts with at most this many comments. Leave empty for no maximum. Note: This filters which posts to include — 'Max comments per post' controls how many comments to extract.\n\nExamples: 100, 500, 1000"
          },
          "flairFilter": {
            "title": "🏷️ Flair Filter",
            "type": "string",
            "description": "Only include posts matching this flair text (case-insensitive partial match). Leave empty for all flairs.\n\nExamples: Discussion, Question, News, Tutorial"
          },
          "domainFilter": {
            "title": "🌐 Domain Filter",
            "type": "string",
            "description": "Only include posts linking to URLs containing this domain. Leave empty for all domains.\n\nExamples: youtube.com, github.com, imgur.com, self.programming"
          },
          "authorFilter": {
            "title": "👤 Author Filter",
            "type": "string",
            "description": "Only include posts by this specific author (username without u/ prefix). Leave empty for all authors.\n\nExamples: spez, GovSchwarzenegger, AutoModerator"
          },
          "includeNSFW": {
            "title": "🔞 Include NSFW content",
            "type": "boolean",
            "description": "Whether to include posts and subreddits marked as Not Safe For Work.\n\nDefault: disabled",
            "default": false
          },
          "postDateLimit": {
            "title": "📅 Post date limit",
            "type": "string",
            "description": "Only scrape posts created after this date. Format: YYYY-MM-DD.\n\nExamples: 2025-01-01, 2026-01-15, 2026-02-01"
          },
          "skipComments": {
            "title": "⏭️ Skip comments",
            "type": "boolean",
            "description": "Don't scrape comments when processing posts. Faster and cheaper if you only need post data.\n\nDefault: disabled",
            "default": false
          },
          "skipUserPosts": {
            "title": "⏭️ Skip user posts",
            "type": "boolean",
            "description": "Don't scrape a user's submitted posts when processing user profiles.\n\nDefault: disabled",
            "default": false
          },
          "skipCommunity": {
            "title": "⏭️ Skip community info",
            "type": "boolean",
            "description": "Don't scrape subreddit metadata (member count, description, rules, etc). Posts will still be scraped.\n\nDefault: disabled",
            "default": false
          },
          "enableDateWindowing": {
            "title": "📅 Enable date windowing",
            "type": "boolean",
            "description": "Break past Reddit's ~1000 post pagination limit by splitting requests into weekly date-range search windows. Enable this when scraping large subreddits with maxPostCount > 1000.\n\nDefault: disabled",
            "default": false
          },
          "ignoreStartUrls": {
            "title": "🚫 Ignore start URLs",
            "type": "boolean",
            "description": "Ignore startUrls and only use search queries and/or subreddits list. Useful for Zapier/API integrations where you don't want the prefilled URL.\n\nDefault: disabled",
            "default": false
          },
          "proxy": {
            "title": "⚙️ Proxy configuration",
            "type": "object",
            "description": "Datacenter proxies work great for Reddit's JSON API. Residential proxies are available if you experience issues but cost significantly more.\n\nDefault: Apify Datacenter proxies",
            "default": {
              "useApifyProxy": true
            }
          },
          "debugMode": {
            "title": "🐛 Debug mode",
            "type": "boolean",
            "description": "Enable verbose logging for troubleshooting. Shows detailed request/response information including filter skip reasons.\n\nDefault: disabled",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}