{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Intelligence Scraper (Pay per Event)",
    "description": "Scrape Reddit posts, full comment trees, user profiles, and search results. Features subreddit monitoring with webhook alerts, batch comparison across multiple subreddits, and AI-native markdown output ready for LLM pipelines and vector databases.",
    "version": "0.0",
    "x-build-id": "GDFSR2pDyt4l3W0lT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/eiv~reddit-intelligence-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-eiv-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/eiv~reddit-intelligence-scraper/runs": {
      "post": {
        "operationId": "runs-sync-eiv-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/eiv~reddit-intelligence-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-eiv-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": [
              "subreddit",
              "post",
              "user",
              "search",
              "batch",
              "monitor"
            ],
            "type": "string",
            "description": "Select what to scrape: subreddit posts, a specific post, user profiles, search results, batch comparison across subreddits, or live monitoring.",
            "default": "subreddit"
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "List of subreddit names to scrape (without r/ prefix). Used for subreddit, batch, and monitor modes.",
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Post URLs",
            "type": "array",
            "description": "Full Reddit post URLs to scrape (including all comments). Used in post mode.",
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Usernames",
            "type": "array",
            "description": "Reddit usernames to scrape (without u/ prefix). Used in user mode.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search Query",
            "type": "string",
            "description": "Search query string. Used in search mode."
          },
          "searchSubreddits": {
            "title": "Search within Subreddits",
            "type": "array",
            "description": "Restrict search to specific subreddits. Leave empty to search all of Reddit.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort Order",
            "enum": [
              "hot",
              "new",
              "top",
              "rising",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "How to sort posts or search results.",
            "default": "hot"
          },
          "timeFilter": {
            "title": "Time Filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time window for top/search sort. Only applies when Sort Order is 'top' or 'relevance'.",
            "default": "week"
          },
          "maxPostsPerSubreddit": {
            "title": "Max Posts Per Subreddit",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of posts to fetch per subreddit. Higher values increase cost.",
            "default": 25
          },
          "includeComments": {
            "title": "Include Comments",
            "type": "boolean",
            "description": "Fetch and include full comment trees for each post. Disable for faster, cheaper runs when you only need post metadata.",
            "default": true
          },
          "maxCommentsPerPost": {
            "title": "Max Comments Per Post",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of comments to fetch per post. Includes replies at all depths.",
            "default": 100
          },
          "commentDepth": {
            "title": "Max Comment Depth",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum depth for nested comment replies (1 = top-level only, 10 = full tree).",
            "default": 5
          },
          "flairFilter": {
            "title": "Flair Filter",
            "type": "string",
            "description": "Only include posts matching this flair text (case-insensitive, partial match)."
          },
          "keywordFilter": {
            "title": "Keyword Filter",
            "type": "array",
            "description": "Only include posts/comments containing at least one of these keywords (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "minScore": {
            "title": "Minimum Score",
            "minimum": 0,
            "type": "integer",
            "description": "Skip posts with score below this threshold. Useful for filtering out low-quality content.",
            "default": 0
          },
          "dateFrom": {
            "title": "Date From (UTC)",
            "type": "string",
            "description": "Only include posts created after this date/time (ISO 8601 format, e.g. 2024-01-01T00:00:00Z). Note: Reddit's API doesn't natively support date filtering — posts will be fetched and filtered client-side."
          },
          "dateTo": {
            "title": "Date To (UTC)",
            "type": "string",
            "description": "Only include posts created before this date/time (ISO 8601 format)."
          },
          "includeNSFW": {
            "title": "Include NSFW Content",
            "type": "boolean",
            "description": "Include posts marked as NSFW (Not Safe For Work).",
            "default": false
          },
          "includeSubredditMeta": {
            "title": "Include Subreddit Metadata",
            "type": "boolean",
            "description": "Attach subreddit metadata (subscriber count, description, etc.) to each result.",
            "default": true
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "json",
              "markdown",
              "both"
            ],
            "type": "string",
            "description": "json: structured JSON only. markdown: AI-ready markdown document. both: include both in every result.",
            "default": "both"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "POST endpoint to receive new matching posts in monitor mode. Required for monitor mode."
          },
          "monitoringInterval": {
            "title": "Monitoring Interval (minutes)",
            "minimum": 2,
            "maximum": 60,
            "type": "integer",
            "description": "How often to poll Reddit for new posts in monitor mode. Minimum 2 minutes.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Apify proxy configuration. Strongly recommended to avoid rate limiting."
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum number of parallel requests. Keep low (1-3) to respect Reddit rate limits.",
            "default": 2
          },
          "debugMode": {
            "title": "Debug Mode",
            "type": "boolean",
            "description": "Enable verbose logging for troubleshooting.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}