{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Comments Scraper",
    "description": "Scrape complete public Reddit comment threads from one or many post or comment URLs. One flat row per comment with author, text, score, timestamps, parent, depth and path metadata, moderation flags and parent-post context. Control sort, reply depth and filters. No Reddit login or API key.",
    "version": "1.0",
    "x-build-id": "bfLvfKXW04Yf4SE2T"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~reddit-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-reddit-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/coregent~reddit-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-coregent-reddit-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/coregent~reddit-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-reddit-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",
        "required": [
          "postUrls"
        ],
        "properties": {
          "postUrls": {
            "title": "Post or comment URLs",
            "type": "array",
            "description": "Reddit post URLs, comment permalinks, redd.it short links, /r/<sub>/s/ share links, or bare post IDs — one per line. Every common form works: https://www.reddit.com/r/AskReddit/comments/1abc234/title/, old.reddit.com and new.reddit.com hosts, https://redd.it/1abc234, t3_1abc234, or just 1abc234. A comment permalink scrapes the whole thread unless 'Focus on the linked comment' is switched on below.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxTotalComments": {
            "title": "Max total comments (whole run)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on comments delivered by this run, across every thread. The run stops as soon as this many comments have been saved. Comments beyond it are never fetched and never charged.",
            "default": 5000
          },
          "maxCommentsPerPost": {
            "title": "Max comments per thread",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Cap per thread. Comments are collected breadth-first — every top-level comment Reddit ranks first, then their replies — so on a huge thread this cap keeps the highest-ranked comments.",
            "default": 500
          },
          "includeNestedReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Follow reply branches under each top-level comment. Switch off to collect top-level comments only — that is the cheapest and fastest mode, one request per 100 comments.",
            "default": true
          },
          "maxDepth": {
            "title": "Max reply depth",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Deepest reply level to collect. 0 = top-level comments only, 1 = direct replies, and so on. Ignored when 'Include replies' is off. Threads stopped by this limit are reported as incomplete in THREAD_SUMMARY.",
            "default": 10
          },
          "commentSort": {
            "title": "Sort",
            "enum": [
              "best",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Reddit's comment ordering. Determines which comments a per-thread cap keeps.",
            "default": "best"
          },
          "expandMoreComments": {
            "title": "Expand 'more comments' placeholders",
            "type": "boolean",
            "description": "Resolve Reddit's collapsed 'load more comments' continuations so threads are complete. Switch off to take only what the first page of each thread shows — much cheaper, never complete.",
            "default": true
          },
          "minScore": {
            "title": "Minimum score",
            "type": "integer",
            "description": "Keep only comments with at least this score. Comments whose score Reddit hides are kept — a hidden score is not a low score."
          },
          "excludeDeletedRemoved": {
            "title": "Exclude deleted and removed comments",
            "type": "boolean",
            "description": "Drop comments deleted by their author or removed by moderators. Off by default because their IDs still hold the thread structure together — a removed parent explains where its replies hang.",
            "default": false
          },
          "excludeStickied": {
            "title": "Exclude stickied comments",
            "type": "boolean",
            "description": "Drop comments pinned by moderators. Only observable when a thread is collected through TikHub (large threads on the auto provider); on Reddit's public surface the flag is not published, so comments are kept.",
            "default": false
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Keep only comments posted on or after this date (ISO 8601, e.g. 2026-08-01 or 2026-08-01T12:00:00Z)."
          },
          "postedBefore": {
            "title": "Posted before",
            "type": "string",
            "description": "Keep only comments posted on or before this date (ISO 8601)."
          },
          "maxScore": {
            "title": "Maximum score",
            "type": "integer",
            "description": "Keep only comments with at most this score. Hidden scores are kept."
          },
          "minLength": {
            "title": "Minimum body length",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only comments whose text is at least this many characters."
          },
          "maxLength": {
            "title": "Maximum body length",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only comments whose text is at most this many characters."
          },
          "includeAuthors": {
            "title": "Only these authors",
            "type": "array",
            "description": "Keep only comments by these usernames (case-insensitive, with or without u/).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeAuthors": {
            "title": "Exclude these authors",
            "type": "array",
            "description": "Drop comments by these usernames — for example AutoModerator.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeKeywords": {
            "title": "Text must contain",
            "type": "array",
            "description": "Keep only comments whose text contains at least one of these terms (case-insensitive substring match).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Text must not contain",
            "type": "array",
            "description": "Drop comments whose text contains any of these terms — for example 'I am a bot'.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "focusOnTargetComment": {
            "title": "Focus on the linked comment",
            "type": "boolean",
            "description": "When an input is a comment permalink, collect that comment, its ancestors (up to the context depth below) and its replies instead of the whole thread. Inputs that are plain post URLs are unaffected.",
            "default": false
          },
          "commentContextDepth": {
            "title": "Ancestor levels in focus mode",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many parent comments above the linked comment to include in focus mode. 0 = the comment and its replies only.",
            "default": 3
          },
          "includePostContext": {
            "title": "Attach post context to every row",
            "type": "boolean",
            "description": "Add the post title, post author and Reddit's total comment count to every comment row. Fetched once per thread and never charged.",
            "default": true
          },
          "skipCommentIds": {
            "title": "Skip these comment IDs",
            "type": "array",
            "description": "Comment IDs (with or without the t1_ prefix) already collected by an earlier run. They are neither saved nor charged, but their replies are still explored — handy for scheduled snapshots of a growing thread.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxConcurrency": {
            "title": "Threads in parallel",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many threads to collect at once (1–5). Each runs on its own proxy session with its own Reddit rate budget.",
            "default": 3
          },
          "requestDelayMs": {
            "title": "Minimum delay between requests (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Extra pacing on top of the built-in rate control. Raise it if Reddit starts answering with 429s."
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Verbose logging of requests, continuations and skips.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Datacenter proxy (the default) or no proxy both work. Apify RESIDENTIAL proxy is refused and fails the run at startup: comment pages are large and residential bandwidth is billed to the Actor, while Reddit serves the same data to datacenter addresses. To route through your own residential provider, use Custom proxy URLs — that traffic goes through your account and is honoured.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}