{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Comments Deep Scraper",
    "description": "Scrape Reddit comment threads for lead discovery, sentiment analysis, market research, and AI datasets. Extract nested replies, scores, authors, timestamps, and parent IDs.",
    "version": "1.2",
    "x-build-id": "24kwSfkHDvxlNddvc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper_guru~reddit-comments-deep-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper_guru-reddit-comments-deep-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/scraper_guru~reddit-comments-deep-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraper_guru-reddit-comments-deep-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/scraper_guru~reddit-comments-deep-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraper_guru-reddit-comments-deep-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": "Post URLs",
            "type": "array",
            "description": "Paste Reddit post URLs to scrape their full comment threads. Example: https://www.reddit.com/r/SaaS/comments/abc123/post_title/",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddit names without r/. Use this for monitoring communities such as SaaS, startups, MachineLearning, LocalLLaMA, or marketing.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search Query",
            "type": "string",
            "description": "Search Reddit for matching posts, then scrape their comments. Useful for brand monitoring, competitor research, and pain-point discovery."
          },
          "subredditSort": {
            "title": "Subreddit Post Sort",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial"
            ],
            "type": "string",
            "description": "How to sort posts when scraping a subreddit (only applies to subreddits, not direct post URLs).",
            "default": "hot"
          },
          "subredditTimeFilter": {
            "title": "Top Posts Time Filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time range when sorting by 'top' or 'controversial'.",
            "default": "week"
          },
          "maxPostsPerSubreddit": {
            "title": "Max Posts per Subreddit",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many posts to process from each subreddit. Keep this low for tests and scheduled monitoring.",
            "default": 1
          },
          "maxCommentsPerPost": {
            "title": "Max Comments per Post",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum total comments to save per post, including nested replies. Use 0 for unlimited.",
            "default": 25
          },
          "maxDepth": {
            "title": "Comment Tree Depth",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How deep to traverse comment reply chains. 1 = top-level only, 2 = replies, 3+ = full tree.",
            "default": 2
          },
          "includeReplies": {
            "title": "Include Replies",
            "type": "boolean",
            "description": "Whether to extract reply threads (nested comments). Disable for faster, flatter output.",
            "default": true
          },
          "minScore": {
            "title": "Minimum Comment Score",
            "type": "integer",
            "description": "Only include comments with at least this many upvotes. 0 = include all (including negatives).",
            "default": 0
          },
          "dateFrom": {
            "title": "Date From (UTC)",
            "type": "string",
            "description": "Only include comments created after this date. Format: YYYY-MM-DD. Leave empty for no limit."
          },
          "includePostInfo": {
            "title": "Include Post Metadata",
            "type": "boolean",
            "description": "Attach parent post info (title, score, author, flair) to each comment record.",
            "default": true
          },
          "skipDeleted": {
            "title": "Skip Deleted/Removed Comments",
            "type": "boolean",
            "description": "Filter out comments where the body is [deleted] or [removed].",
            "default": true
          },
          "redditClientId": {
            "title": "Reddit Client ID",
            "type": "string",
            "description": "Optional but recommended. Use a Reddit app client ID for stable access through oauth.reddit.com."
          },
          "redditClientSecret": {
            "title": "Reddit Client Secret",
            "type": "string",
            "description": "Optional but recommended. Stored as an encrypted secret input on Apify."
          },
          "redditUserAgent": {
            "title": "Reddit User Agent",
            "type": "string",
            "description": "Optional custom Reddit API User-Agent. Example: python:my-reddit-researcher:1.0 (by /u/your_username)",
            "default": "python:reddit-comments-deep-scraper:1.2 (by /u/apify-user)"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional fallback proxy settings. OAuth credentials are recommended first; proxies can help with public endpoint fallback.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}