{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Comment Scraper | Threads & Replies",
    "description": "Extract Reddit comments, scores, authors, timestamps, permalinks, and nested reply paths. Fast HTTP-first collection with automatic browser fallback.",
    "version": "1.0",
    "x-build-id": "KJKNAltaJwuiU1Es5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/newbs~reddit-comment-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-newbs-reddit-comment-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/newbs~reddit-comment-scraper/runs": {
      "post": {
        "operationId": "runs-sync-newbs-reddit-comment-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/newbs~reddit-comment-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-newbs-reddit-comment-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": "Reddit Post URLs",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "One or more direct Reddit post URLs. Supports reddit.com, old.reddit.com, and redd.it links. Subreddit listing and search URLs are not supported.",
            "items": {
              "type": "string",
              "pattern": "^https?://((www|old|new|np)\\.)?reddit\\.com/(r/[^/]+/)?comments/[A-Za-z0-9]+(/[^?#]*)?([?#].*)?$|^https?://redd\\.it/[A-Za-z0-9]+([/?#].*)?$"
            }
          },
          "maxComments": {
            "title": "Maximum Comments",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum saved comments per post, including replies. This also caps pay-per-event result charges. Start with 25, then increase after checking the output.",
            "default": 25
          },
          "includeReplies": {
            "title": "Include Nested Replies",
            "type": "boolean",
            "description": "Collect nested replies and preserve their parent-child thread structure. Disable this to collect top-level comments only.",
            "default": true
          },
          "maxCommentDepth": {
            "title": "Maximum Reply Depth",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Deepest reply level to save. Use 0 for top-level comments only, 1 for direct replies, or 20 for all available levels.",
            "default": 20
          },
          "sortBy": {
            "title": "Sort Comments By",
            "enum": [
              "top",
              "best",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "How to sort comments before collection. This affects which comments are collected when using maxComments limit.",
            "default": "top"
          },
          "maxConcurrency": {
            "title": "Maximum Concurrent Posts",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Maximum number of Reddit posts to process at the same time. Increase for faster runs, lower it if Reddit blocks requests.",
            "default": 2
          },
          "proxy": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Residential proxies provide the best Reddit success rate. Keep the default unless you have tested another proxy configuration.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          },
          "mcpOutputConnectors": {
            "title": "MCP Output Connectors",
            "minItems": 0,
            "uniqueItems": true,
            "type": "array",
            "description": "Optional Apify MCP connectors used after scraping to send a compact run summary and dataset link to an external tool such as Slack, Notion, GitHub, or another MCP-compatible destination.",
            "default": []
          },
          "mcpToolName": {
            "title": "MCP Tool Name",
            "type": "string",
            "description": "Optional exact MCP tool name to call on each selected output connector. Leave empty to auto-select the first output-writing tool exposed by the connector."
          },
          "mcpToolArguments": {
            "title": "MCP Tool Arguments",
            "type": "object",
            "description": "Optional JSON object merged into the MCP tool call. Use this for required destination fields such as channel, channel_id, database_id, repository, or page_id.",
            "default": {},
            "additionalProperties": true
          },
          "mcpMessageTemplate": {
            "title": "MCP Message Template",
            "type": "string",
            "description": "Optional message template sent to MCP output tools. Supported tokens: {{rowsPushed}}, {{postsProcessed}}, {{datasetUrl}}, {{datasetApiUrl}}, {{runUrl}}, {{postUrls}}, {{sortBy}}, {{includeReplies}}."
          },
          "failOnMcpDeliveryError": {
            "title": "Fail On MCP Delivery Error",
            "type": "boolean",
            "description": "When enabled, the run fails if connector delivery fails. Keep disabled to preserve scraped dataset results even if a destination tool needs different arguments.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}