{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Comment Scraper | Replies & CSV Export",
    "description": "Export Reddit comments and nested replies from post URLs to CSV, Excel or JSON. Get text, authors, scores and timestamps for feedback research or AI workflows. Monitor only new comments across runs. No Reddit login or API key needed. Try 10 comments first.",
    "version": "1.0",
    "x-build-id": "lF48dexGoNlpiofaX"
  },
  "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": "Paste direct public post URLs from Reddit, old.reddit.com or redd.it. Alternate links to the same post are processed once per run. Subreddit and search pages 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 per post",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum saved rows per post, including replies. Start with 10 ($0.06 in result charges per post, plus start and platform usage). Two URLs with a limit of 10 can save 20 paid rows. The run spending limit can stop collection earlier.",
            "default": 10
          },
          "sortBy": {
            "title": "Sort Comments By",
            "enum": [
              "top",
              "best",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "Choose which comments to prioritize. Use Top for popular feedback, New for recurring monitoring. Reply trees are not globally ordered by score or time.",
            "default": "top"
          },
          "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
          },
          "onlyNewComments": {
            "title": "Only Save New Comments",
            "type": "boolean",
            "description": "Save only comment IDs not remembered from earlier runs with the same Monitoring Key. Unseen comments beyond the result limit remain eligible next time. Use sortBy=new for monitoring and sinceTimestamp to exclude older history.",
            "default": false
          },
          "monitoringKey": {
            "title": "Monitoring Key",
            "pattern": "^[A-Za-z0-9._-]+$",
            "minLength": 1,
            "maxLength": 80,
            "type": "string",
            "description": "Stable name that isolates one monitor from another. Keep the same key across scheduled runs. Change it to start a fresh monitoring history.",
            "default": "default"
          },
          "sinceTimestamp": {
            "title": "Only Comments Since",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T.+$",
            "type": "string",
            "description": "Optional ISO 8601 timestamp. Comments older than this time are skipped and never charged. Example: 2026-09-01T00:00:00.000Z."
          },
          "monitoringScanLimit": {
            "title": "Comments To Scan Per Post",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many recent comments to inspect when monitoring or filtering by time. This can be higher than Maximum Comments so already-seen rows do not hide new replies.",
            "default": 100
          },
          "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
          },
          "maxConcurrency": {
            "title": "Maximum Concurrent Posts",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Maximum posts processed at once. Keep 2 for a first run. More concurrent browser pages can slow down a memory- or CPU-limited run; use 1 for large threads at 1 GB.",
            "default": 2
          },
          "proxy": {
            "title": "Proxy settings",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}