{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Opportunity Finder",
    "description": "Find Reddit-backed opportunities from up to 30 posts and 150 comments by default, with evidence URLs, transparent research plans, and optional BYOK AI.",
    "version": "0.1",
    "x-build-id": "E5PdSzAQOvS4VXGIG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/signalflow_studio~reddit-opportunity-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-signalflow_studio-reddit-opportunity-finder",
        "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/signalflow_studio~reddit-opportunity-finder/runs": {
      "post": {
        "operationId": "runs-sync-signalflow_studio-reddit-opportunity-finder",
        "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/signalflow_studio~reddit-opportunity-finder/run-sync": {
      "post": {
        "operationId": "run-sync-signalflow_studio-reddit-opportunity-finder",
        "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": {
          "analysisGoal": {
            "title": "Analysis goal",
            "type": "string",
            "description": "What should this Reddit intelligence report answer? This guides keyword hints and report framing; explicit subreddits and keywords still control Reddit collection."
          },
          "preset": {
            "title": "Reddit intelligence preset",
            "enum": [
              "custom",
              "shopify_app_opportunities",
              "ai_saas_competitor_complaints",
              "creator_tools",
              "local_business_software",
              "b2b_sales_tools"
            ],
            "type": "string",
            "description": "Optional vertical preset that fills default Reddit communities, keywords, competitors, and scoring focus. Custom keeps full manual control.",
            "default": "custom"
          },
          "market": {
            "title": "Market or niche",
            "type": "string",
            "description": "Market context used in search terms, report answer, and opportunity framing."
          },
          "decisionGoal": {
            "title": "Decision goal",
            "enum": [
              "find_product_opportunities",
              "monitor_competitors",
              "validate_market",
              "find_content_angles",
              "detect_alerts"
            ],
            "type": "string",
            "description": "What the report should help decide.",
            "default": "find_product_opportunities"
          },
          "maxPosts": {
            "title": "Max posts",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum public Reddit posts to fetch. Default public run analyzes up to 30 posts; hard-capped at 50 to keep runtime and proxy usage bounded.",
            "default": 30
          },
          "maxOpportunities": {
            "title": "Max opportunities",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Maximum opportunities to output.",
            "default": 10
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Public subreddits to search, without the r/ prefix. Presets provide defaults; explicit values override preset sources.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Pain-point and product-discovery phrases to search for. analysisGoal and market add transparent keyword hints.",
            "items": {
              "type": "string"
            }
          },
          "knownCompetitors": {
            "title": "Known competitors",
            "type": "array",
            "description": "Optional tool/competitor names to track in entity recognition.",
            "items": {
              "type": "string"
            }
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Reddit search time range.",
            "default": "month"
          },
          "sort": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "new",
              "top",
              "comments"
            ],
            "type": "string",
            "description": "Reddit search sort.",
            "default": "relevance"
          },
          "aiProvider": {
            "title": "AI provider",
            "enum": [
              "none",
              "deepseek",
              "openai",
              "openrouter",
              "anthropic",
              "gemini",
              "custom_openai_compatible"
            ],
            "type": "string",
            "description": "Optional BYOK AI provider. Rules-based Reddit intelligence always runs first and does not require an AI key.",
            "default": "none"
          },
          "aiMode": {
            "title": "AI mode",
            "enum": [
              "off",
              "polish",
              "cluster",
              "full"
            ],
            "type": "string",
            "description": "polish adds final insight, cluster groups evidence signals into stronger opportunities, full does both.",
            "default": "off"
          },
          "aiApiKey": {
            "title": "AI API key",
            "type": "string",
            "description": "User-provided BYOK key. When set, model API costs are billed by the selected AI provider to the key owner."
          },
          "aiModel": {
            "title": "AI model",
            "type": "string",
            "description": "Model name for the selected provider, for example deepseek-chat, gpt-4.1-mini, openai/gpt-4.1-mini, claude-3-5-haiku-latest, or gemini-2.0-flash."
          },
          "aiBaseUrl": {
            "title": "AI base URL",
            "type": "string",
            "description": "Optional API base URL. Leave empty to use the selected provider default."
          },
          "maxAiInputChars": {
            "title": "Max AI input characters",
            "minimum": 1000,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum characters sent to the AI provider. This limits call size but is not an exact billing cap.",
            "default": 30000
          },
          "maxAiOutputTokens": {
            "title": "Max AI output tokens",
            "minimum": 500,
            "maximum": 4000,
            "type": "integer",
            "description": "Maximum AI output tokens. This limits call size but is not an exact billing cap.",
            "default": 1800
          },
          "trendMode": {
            "title": "Trend mode",
            "type": "boolean",
            "description": "Add monitoring-style new/recurring/rising summaries.",
            "default": false
          },
          "previousReport": {
            "title": "Previous report JSON",
            "type": "object",
            "description": "Optional previous output JSON for monitoring comparisons."
          },
          "monitoringOnly": {
            "title": "Monitoring only",
            "type": "boolean",
            "description": "Only keep opportunities that pass alertThreshold after analysis. Useful for scheduled alerts.",
            "default": false
          },
          "alertThreshold": {
            "title": "Alert threshold",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Opportunity score threshold for alert generation and monitoringOnly filtering.",
            "default": 70
          },
          "dedupeAgainstPrevious": {
            "title": "Dedupe against previous report",
            "type": "boolean",
            "description": "Compare current opportunities against previousReport when provided.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Fetch and analyze public comments as supporting evidence. Comments improve evidence depth but can increase runtime and Apify platform usage.",
            "default": true
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum comments to fetch per post. Default is 8; hard-capped at 20.",
            "default": 8
          },
          "maxTotalComments": {
            "title": "Max total comments",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum comments to analyze across all posts. Default public run analyzes up to 150 comments; hard-capped at 500.",
            "default": 150
          },
          "maxInputChars": {
            "title": "Max input characters",
            "minimum": 1000,
            "maximum": 400000,
            "type": "integer",
            "description": "Maximum characters of combined post/comment text to analyze.",
            "default": 200000
          },
          "analysisDepth": {
            "title": "Analysis depth",
            "enum": [
              "quick",
              "standard",
              "deep"
            ],
            "type": "string",
            "description": "Controls intended analysis depth. Deep mode is best with AI clustering enabled.",
            "default": "standard"
          },
          "opportunityFocus": {
            "title": "Opportunity focus",
            "enum": [
              "balanced",
              "micro_saas",
              "agency_services",
              "content",
              "competitor_switching"
            ],
            "type": "string",
            "description": "Bias scoring toward a specific type of opportunity.",
            "default": "balanced"
          },
          "reportType": {
            "title": "Report type",
            "enum": [
              "micro_saas_ideas",
              "competitor_complaints",
              "content_ideas",
              "feature_requests"
            ],
            "type": "string",
            "description": "Opportunity lens for titles, suggested products, and scoring.",
            "default": "micro_saas_ideas"
          },
          "minScore": {
            "title": "Minimum opportunity score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Filter out opportunities below this score.",
            "default": 0
          },
          "minBuyingIntent": {
            "title": "Minimum buying intent",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Filter out low-intent signals before opportunity clustering.",
            "default": 0
          },
          "minDistinctEvidencePosts": {
            "title": "Min distinct evidence posts",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Minimum distinct Reddit threads required before an opportunity is emitted.",
            "default": 2
          },
          "dedupeStrength": {
            "title": "Dedupe strength",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string",
            "description": "How aggressively similar evidence signals are deduplicated.",
            "default": "medium"
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Skip posts/comments that contain these terms.",
            "items": {
              "type": "string"
            }
          },
          "trackEntities": {
            "title": "Track tools and competitors",
            "type": "boolean",
            "description": "Extract mentioned tools/competitors from public posts and comments.",
            "default": true
          },
          "excludePromotionalPosts": {
            "title": "Exclude promotional posts",
            "type": "boolean",
            "description": "Skip obvious launch/self-promotion posts as primary evidence while still analyzing their comments.",
            "default": true
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "json",
              "markdown",
              "csv"
            ],
            "type": "string",
            "description": "Primary report format. Markdown is always generated as well.",
            "default": "markdown"
          },
          "includeRawSignals": {
            "title": "Include raw signals",
            "type": "boolean",
            "description": "Include sanitized extracted signal objects in output JSON.",
            "default": false
          },
          "includeEvidenceTable": {
            "title": "Include evidence table",
            "type": "boolean",
            "description": "Include a compact evidence table in JSON and Markdown.",
            "default": true
          },
          "language": {
            "title": "Report language",
            "enum": [
              "en",
              "zh"
            ],
            "type": "string",
            "description": "Language hint for summaries and AI output.",
            "default": "en"
          },
          "reportTone": {
            "title": "Report tone",
            "enum": [
              "operator",
              "investor",
              "founder",
              "marketer"
            ],
            "type": "string",
            "description": "Audience lens for report phrasing.",
            "default": "operator"
          },
          "proxyType": {
            "title": "Proxy type",
            "enum": [
              "auto",
              "none",
              "residential"
            ],
            "type": "string",
            "description": "Use auto for direct local requests and Apify RESIDENTIAL proxy in cloud. Use none only for local debugging.",
            "default": "auto"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "reddit_discovery",
              "analyze_dataset"
            ],
            "type": "string",
            "description": "Use reddit_discovery for real public Reddit analysis. analyze_dataset is only for testing with Reddit-like JSON.",
            "default": "reddit_discovery"
          },
          "posts": {
            "title": "Posts",
            "type": "array",
            "description": "Reddit-like posts for analyze_dataset mode only."
          },
          "businessQuestion": {
            "title": "Legacy business question",
            "type": "string",
            "description": "Backward-compatible alias. Prefer analysisGoal.",
            "default": ""
          },
          "useAi": {
            "title": "Legacy use AI",
            "type": "boolean",
            "description": "Backward-compatible alias accepted to prevent old inputs from failing. Prefer aiProvider and aiMode.",
            "default": false
          },
          "useOwnerAiKey": {
            "title": "Legacy owner AI key",
            "type": "boolean",
            "description": "Backward-compatible alias accepted to prevent old inputs from failing. Ignored in public runs; AI only uses aiApiKey.",
            "default": false
          },
          "aiEnhancement": {
            "title": "Legacy AI enhancement",
            "type": "string",
            "description": "Backward-compatible alias. Prefer aiProvider and aiMode.",
            "default": "off"
          },
          "deepseekModel": {
            "title": "Legacy DeepSeek model",
            "type": "string",
            "description": "Backward-compatible alias. Prefer aiModel.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}