{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Intelligence Scraper",
    "description": "Scrape Reddit posts, comments, user profiles & subreddit analytics at scale. No API key needed. Supports all sort types (hot, new, top, rising). Built for market research, brand monitoring, sentiment analysis & AI/ML datasets. Outputs clean JSON, CSV & Markdown. Pay only per result scraped.",
    "version": "1.0",
    "x-build-id": "4yoCo1VVo3efI9PIG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apage~reddit-intelligence-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apage-reddit-intelligence-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/apage~reddit-intelligence-scraper/runs": {
      "post": {
        "operationId": "runs-sync-apage-reddit-intelligence-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/apage~reddit-intelligence-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-apage-reddit-intelligence-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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Scraping Mode",
            "enum": [
              "subredditPosts",
              "commentThreads",
              "userProfiles",
              "subredditAnalytics",
              "search"
            ],
            "type": "string",
            "description": "Choose what type of Reddit data to extract.",
            "default": "subredditPosts"
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "List of subreddit names to scrape (without the r/ prefix). Used in 'Subreddit Posts' and 'Subreddit Analytics' modes.",
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Post URLs",
            "type": "array",
            "description": "Direct links to Reddit posts for comment thread scraping. Used in 'Comment Threads' mode.",
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Usernames",
            "type": "array",
            "description": "Reddit usernames to scrape profiles for (without u/ prefix). Used in 'User Profiles' mode.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search Query",
            "type": "string",
            "description": "Keyword search query to find relevant Reddit posts and comments. Used in 'Keyword Search' mode. Supports Reddit search syntax (AND, OR, NOT, quotes for exact phrases)."
          },
          "searchType": {
            "title": "Search Result Type",
            "enum": [
              "posts",
              "comments",
              "both"
            ],
            "type": "string",
            "description": "Type of search results to return. Used in 'Keyword Search' mode.",
            "default": "posts"
          },
          "sortBy": {
            "title": "Sort Posts By",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "controversial",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "How to sort results. 'Relevance' and 'Comments' are available in Keyword Search mode.",
            "default": "hot"
          },
          "timeRange": {
            "title": "Time Range",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time range filter when sorting by 'Top' or 'Controversial'.",
            "default": "week"
          },
          "maxPosts": {
            "title": "Max Posts",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of posts to scrape per subreddit. Reddit API returns up to ~1000 posts per listing.",
            "default": 100
          },
          "includeComments": {
            "title": "Include Comments",
            "type": "boolean",
            "description": "Whether to also scrape comments for each post. This significantly increases scraping time and cost.",
            "default": false
          },
          "maxCommentDepth": {
            "title": "Max Comment Depth",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum depth of comment replies to scrape (1 = top-level only).",
            "default": 3
          },
          "expandMoreComments": {
            "title": "Expand Hidden Comments",
            "type": "boolean",
            "description": "Fetch additional comments hidden behind Reddit's 'more comments' links. Increases completeness but also increases scraping time and API requests.",
            "default": false
          },
          "sortComments": {
            "title": "Sort Comments By",
            "enum": [
              "confidence",
              "top",
              "new",
              "controversial",
              "old",
              "qa"
            ],
            "type": "string",
            "description": "How to sort comments within each post.",
            "default": "confidence"
          },
          "maxItems": {
            "title": "Max Items per User",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of posts/comments to scrape per user profile. Used in 'User Profiles' mode.",
            "default": 100
          },
          "includeUserPosts": {
            "title": "Include User Posts",
            "type": "boolean",
            "description": "Include the user's submitted posts in profile scraping.",
            "default": true
          },
          "includeUserComments": {
            "title": "Include User Comments",
            "type": "boolean",
            "description": "Include the user's comment history in profile scraping.",
            "default": true
          },
          "includeRules": {
            "title": "Include Subreddit Rules",
            "type": "boolean",
            "description": "Include subreddit rules in analytics output.",
            "default": true
          },
          "includeModerators": {
            "title": "Include Moderators",
            "type": "boolean",
            "description": "Include moderator list in analytics output.",
            "default": false
          },
          "filterKeywords": {
            "title": "Include Keywords",
            "type": "array",
            "description": "Only keep results containing at least one of these keywords (case-insensitive). Searches in title, body, and description. Leave empty to keep all results.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude Keywords",
            "type": "array",
            "description": "Remove results containing any of these keywords (case-insensitive). Useful for filtering out irrelevant topics.",
            "items": {
              "type": "string"
            }
          },
          "enableSentiment": {
            "title": "Enable Sentiment Analysis",
            "type": "boolean",
            "description": "Add sentiment scoring (positive/negative/neutral/mixed) to each post and comment. Uses a fast built-in lexicon — no API calls, no extra cost.",
            "default": true
          },
          "enableScoring": {
            "title": "Enable Engagement Scoring",
            "type": "boolean",
            "description": "Add engagement metrics (virality score, engagement rate, controversy detection, quality signal) to each post and comment.",
            "default": true
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "json",
              "csv",
              "markdown"
            ],
            "type": "string",
            "description": "Format of the output data. JSON is default and works with Apify integrations. CSV is good for spreadsheets. Markdown is optimized for RAG/LLM pipelines.",
            "default": "json"
          },
          "proxyConfig": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy servers to use for scraping. Residential proxies are recommended to avoid rate limits.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "maxRequestsPerMinute": {
            "title": "Max Requests Per Minute",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Maximum number of HTTP requests per minute to Reddit. Lower values reduce the chance of rate limiting but slow down scraping. Reddit allows ~60 req/min for unauthenticated access.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}