{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Scraper - Posts, Comments & Subreddits",
    "description": "Extract Reddit posts, nested comments, subreddits, search results, and user profiles with 180+ fields. No API key required.",
    "version": "0.0",
    "x-build-id": "gSLfr7bzfGdadVGPs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/knowten~reddit-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-knowten-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/knowten~reddit-scraper/runs": {
      "post": {
        "operationId": "runs-sync-knowten-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/knowten~reddit-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-knowten-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": {
          "searchTerms": {
            "title": "Search Keywords",
            "type": "array",
            "description": "Keywords or search phrases to search across Reddit. Each keyword runs as a separate query.",
            "items": {
              "type": "string"
            }
          },
          "searchPosts": {
            "title": "Search for posts",
            "type": "boolean",
            "description": "Enable to search for posts matching the search keywords.",
            "default": true
          },
          "searchComments": {
            "title": "Search for comments",
            "type": "boolean",
            "description": "Enable to search for comments matching the search keywords.",
            "default": false
          },
          "searchCommunities": {
            "title": "Search for communities",
            "type": "boolean",
            "description": "Enable to search for subreddits matching the search keywords.",
            "default": false
          },
          "withinCommunity": {
            "title": "Limit search to ONE community",
            "type": "string",
            "description": "Search inside a specific subreddit only (e.g. r/technology, r/gaming, indiegames)."
          },
          "searchSort": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "Sort order for keyword search results.",
            "default": "new"
          },
          "searchTime": {
            "title": "Time range",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time filter for keyword search results and top listings.",
            "default": "all"
          },
          "startUrls": {
            "title": "Direct URLs",
            "type": "array",
            "description": "Direct Reddit URLs: post links, comment permalinks, user profiles, subreddit pages, or search pages.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "fastMode": {
            "title": "Fast mode for search page URLs",
            "type": "boolean",
            "description": "Uses direct JSON API endpoints for search URLs, skipping unnecessary HTML parsing.",
            "default": true
          },
          "subredditUrls": {
            "title": "Full Subreddit Scrape",
            "type": "array",
            "description": "Subreddit names (e.g. AskReddit, r/AskReddit) or community links to deep scrape.",
            "items": {
              "type": "string"
            }
          },
          "postedAfter": {
            "title": "Posts created on or after (YYYY-MM-DD)",
            "type": "string",
            "description": "Filter posts created on or after this UTC date (e.g. 2025-01-01)."
          },
          "postedBefore": {
            "title": "Posts created on or before (YYYY-MM-DD)",
            "type": "string",
            "description": "Filter posts created on or before this UTC date (e.g. 2025-12-31)."
          },
          "commentedAfter": {
            "title": "Comments created on or after (YYYY-MM-DD)",
            "type": "string",
            "description": "Filter comments created on or after this UTC date."
          },
          "commentedBefore": {
            "title": "Comments created on or before (YYYY-MM-DD)",
            "type": "string",
            "description": "Filter comments created on or before this UTC date."
          },
          "onlyWithFlair": {
            "title": "Only posts that have a flair",
            "type": "boolean",
            "description": "Keep only posts that have a flair assigned.",
            "default": false
          },
          "crawlCommentsPerPost": {
            "title": "Scrape comments for each post",
            "type": "boolean",
            "description": "Collect full comment threads (including nested replies) for extracted posts.",
            "default": false
          },
          "includeNSFW": {
            "title": "Include NSFW (18+) content",
            "type": "boolean",
            "description": "Include NSFW posts and communities in results.",
            "default": false
          },
          "maxPostsCount": {
            "title": "Max posts (total across all inputs)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of posts to collect.",
            "default": 100
          },
          "maxCommentsCount": {
            "title": "Max search comments (keyword search only)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of comments to collect from keyword search.",
            "default": 100
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of comments to collect per post when comment crawling is enabled.",
            "default": 100
          },
          "maxCommunitiesCount": {
            "title": "Max communities",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of communities to collect.",
            "default": 100
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Configure proxies to prevent rate limits and IP blocking. Apify Residential Proxy recommended.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "mcpMode": {
            "title": "MCP Delivery Mode",
            "enum": [
              "perPost",
              "summary",
              "disabled"
            ],
            "type": "string",
            "description": "How to deliver items to MCP connectors.",
            "default": "perPost"
          },
          "mcpMessage": {
            "title": "MCP Message Template",
            "type": "string",
            "description": "Message template for MCP connectors with placeholders like {{title}}, {{postUrl}}, etc.",
            "default": "**{{title}}**\n{{postUrl}}"
          },
          "mcpComments": {
            "title": "MCP Comments Handling",
            "enum": [
              "ignore",
              "bundle",
              "separate"
            ],
            "type": "string",
            "description": "How to handle comments for MCP delivery.",
            "default": "ignore"
          },
          "mcpCommentsPerPost": {
            "title": "MCP Top Comments Count",
            "minimum": 1,
            "type": "integer",
            "description": "Number of top comments to bundle when mcpComments is set to bundle.",
            "default": 5
          },
          "mcpMaxItems": {
            "title": "MCP Max Items",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum items to push through MCP connectors.",
            "default": 50
          },
          "customLabels": {
            "title": "Custom Labels (Optional)",
            "type": "object",
            "description": "Key-value pair of custom analysis labels if applicable.",
            "default": {}
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}