{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper",
    "description": "Powerful Reddit scraper to extract posts, comments, and user data. Supports subreddit crawling, keyword search, user profiles, date filtering, score thresholds, and nested comment threads. Export to JSON, CSV, or webhook. Perfect for market research, sentiment analysis, and content monitoring.",
    "version": "0.0",
    "x-build-id": "WpFHNUNxfpxVOzWql"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/keratogenous_surgeon~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-keratogenous_surgeon-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/keratogenous_surgeon~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-keratogenous_surgeon-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/keratogenous_surgeon~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-keratogenous_surgeon-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": {
          "mode": {
            "title": "Scraping Mode",
            "enum": [
              "subreddits",
              "search",
              "user"
            ],
            "type": "string",
            "description": "Choose what to scrape: subreddits, search results, or user profiles.",
            "default": "subreddits"
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "List of subreddit names to scrape (without r/ prefix). Only used in 'subreddits' mode.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "Search terms to find posts across Reddit. Only used in 'search' mode.",
            "items": {
              "type": "string"
            }
          },
          "searchInSubreddit": {
            "title": "Search Within Subreddit",
            "type": "string",
            "description": "Limit search to a specific subreddit (optional). Leave empty to search all of Reddit."
          },
          "usernames": {
            "title": "Usernames",
            "type": "array",
            "description": "Reddit usernames to scrape posts/comments from. Only used in 'user' mode.",
            "items": {
              "type": "string"
            }
          },
          "userContentType": {
            "title": "User Content Type",
            "enum": [
              "overview",
              "submitted",
              "comments"
            ],
            "type": "string",
            "description": "What to scrape from user profiles.",
            "default": "submitted"
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "relevance"
            ],
            "type": "string",
            "description": "How to sort the posts.",
            "default": "hot"
          },
          "timeFilter": {
            "title": "Time Filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time range for top/search posts.",
            "default": "day"
          },
          "maxPostsPerSource": {
            "title": "Max Posts per Source",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of posts to scrape per subreddit/search/user.",
            "default": 100
          },
          "minScore": {
            "title": "Minimum Score",
            "minimum": 0,
            "type": "integer",
            "description": "Only include posts with at least this many upvotes (0 = no filter).",
            "default": 0
          },
          "minComments": {
            "title": "Minimum Comments",
            "minimum": 0,
            "type": "integer",
            "description": "Only include posts with at least this many comments (0 = no filter).",
            "default": 0
          },
          "includeKeywords": {
            "title": "Include Keywords",
            "type": "array",
            "description": "Only include posts containing ANY of these keywords in title or body (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude Keywords",
            "type": "array",
            "description": "Exclude posts containing ANY of these keywords in title or body (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "postType": {
            "title": "Post Type Filter",
            "enum": [
              "all",
              "text",
              "link",
              "image",
              "video"
            ],
            "type": "string",
            "description": "Filter by content type.",
            "default": "all"
          },
          "dateFrom": {
            "title": "Date From",
            "type": "string",
            "description": "Only include posts created after this date (YYYY-MM-DD format)."
          },
          "dateTo": {
            "title": "Date To",
            "type": "string",
            "description": "Only include posts created before this date (YYYY-MM-DD format)."
          },
          "includeComments": {
            "title": "Include Comments",
            "type": "boolean",
            "description": "Whether to scrape comments for each post.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max Comments per Post",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of comments to scrape per post.",
            "default": 25
          },
          "includeNestedReplies": {
            "title": "Include Nested Replies",
            "type": "boolean",
            "description": "Scrape replies to comments (nested threads). Slower but more complete.",
            "default": false
          },
          "maxReplyDepth": {
            "title": "Max Reply Depth",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How deep to go in nested comment threads (1-10).",
            "default": 3
          },
          "downloadMedia": {
            "title": "Download Media",
            "type": "boolean",
            "description": "Download images and videos from posts to Key-Value Store.",
            "default": false
          },
          "mediaTypes": {
            "title": "Media Types to Download",
            "type": "array",
            "description": "Types of media to download.",
            "items": {
              "type": "string",
              "enum": [
                "images",
                "videos",
                "gifs"
              ]
            },
            "default": [
              "images"
            ]
          },
          "skipDuplicates": {
            "title": "Skip Duplicates (Incremental)",
            "type": "boolean",
            "description": "Skip posts that were already scraped in previous runs (uses Key-Value Store to track).",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Send scraped data to this webhook URL in real-time (optional)."
          },
          "webhookBatchSize": {
            "title": "Webhook Batch Size",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Number of posts to batch before sending to webhook.",
            "default": 10
          },
          "maxRequestsPerCrawl": {
            "title": "Max Requests per Crawl",
            "type": "integer",
            "description": "Maximum number of HTTP requests.",
            "default": 1000
          },
          "proxyConfig": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings for the crawler."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}