{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Comment Threads, No Login",
    "description": "Scrape Reddit posts with their comment threads from subreddits, searches, user pages or post URLs, with sort, time range and comment depth control. No login needed.",
    "version": "1.0",
    "x-build-id": "LbeCK3F2J5MuWwz46"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/icoe-man~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-icoe-man-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/icoe-man~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-icoe-man-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/icoe-man~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-icoe-man-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",
        "properties": {
          "startUrls": {
            "title": "Reddit URLs",
            "type": "array",
            "description": "Subreddits (https://www.reddit.com/r/technology/ or r/technology), posts (.../comments/<id>/...), users (https://www.reddit.com/user/<name>/) or search pages, one per line. A user link collects posts by that user. Up to 1,000 URLs and 200 subreddits, users and searches per run. Subreddits, users and searches we have not collected recently are limited to about 35 per run at 25 posts × 20 comments (more with fewer posts or comments), so split bigger jobs across runs.",
            "items": {
              "type": "string"
            }
          },
          "searches": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search all of Reddit, one per line. Reddit search operators work, e.g. subreddit:technology or author:<name>. Each search has a small fee.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort posts by",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "Order of the posts. Subreddits support Hot, New, Top, Rising and Controversial. Searches support Relevance, Hot, Top, New and Most comments. Leave empty, or pick one a listing does not support, to use Hot for subreddits and Relevance for searches."
          },
          "time": {
            "title": "Time range",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time range for Top and Controversial (subreddits) or Relevance, Top and Most comments (searches). Ignored for other sorts. Leave empty for the default range."
          },
          "maxPostsPerSource": {
            "title": "Max posts per subreddit, user or search",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many posts to collect from each subreddit, user or search. Each post is billed, plus a small fee per subreddit, user or search. With comments on, large requests are cut to fewer posts: about 600 at up to 40 comments per post, 270 at 100 or 58 at 500 (the run's OUTPUT notes it).",
            "default": 25
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Also collect the comment thread of every post. Each comment is billed, plus a small fee per post whose comments we collect (post URLs always carry this fee).",
            "default": true
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many comments to collect per post, across all reply levels.",
            "default": 20
          },
          "commentDepth": {
            "title": "Comment depth",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many reply levels to collect: 1 = top-level comments only, 2 = comments plus their direct replies, up to 5.",
            "default": 2
          },
          "commentSort": {
            "title": "Sort comments by",
            "enum": [
              "top",
              "best",
              "new",
              "old",
              "controversial",
              "qa"
            ],
            "type": "string",
            "description": "Which comments Reddit should return first.",
            "default": "top"
          },
          "onlyNewerThan": {
            "title": "Only posts newer than (subreddits sorted by New)",
            "type": "string",
            "description": "Skip posts created before this date. Use a date like 2026-01-31 or a relative value like \"7 days\". Only applies to subreddits with Sort posts by set to New; it is ignored for searches, users and other sorts."
          },
          "maxDataAgeHours": {
            "title": "Reuse data collected within (hours)",
            "minimum": 0,
            "maximum": 720,
            "type": "integer",
            "description": "If we collected these posts and comments within this many hours, you get them instantly at the same price. The form starts at 720 (30 days) so the example finishes instantly: use 12 or less for recent data, or 0 to always collect fresh data.",
            "default": 12
          },
          "cacheOnly": {
            "title": "Previously collected data only (instant)",
            "type": "boolean",
            "description": "Return only data we already collected, without waiting for live collection. Useful for AI agents with short timeouts.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}