{
  "openapi": "3.0.1",
  "info": {
    "title": "Reddit Sentiment & Trend Tracker — Mention Volume & Charts",
    "description": "Track Reddit mention volume & sentiment for stocks, crypto, brands & topics. Chart-ready hourly/daily trends, per-mention scores, top posts & spike webhooks. Finance & product lexicons. Search + scan mode. Zero API key. Schedule runs on Apify.",
    "version": "0.0",
    "x-build-id": "xzkWMFNOxbhSTeC8X"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/b2b_leads~Reddit-Sentiment-and-Trend-Tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-b2b_leads-Reddit-Sentiment-and-Trend-Tracker",
        "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/b2b_leads~Reddit-Sentiment-and-Trend-Tracker/runs": {
      "post": {
        "operationId": "runs-sync-b2b_leads-Reddit-Sentiment-and-Trend-Tracker",
        "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/b2b_leads~Reddit-Sentiment-and-Trend-Tracker/run-sync": {
      "post": {
        "operationId": "run-sync-b2b_leads-Reddit-Sentiment-and-Trend-Tracker",
        "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": {
          "termGroups": {
            "title": "Keywords to track",
            "type": "array",
            "description": "One entry per keyword group on your charts. Format: Label: alias1, alias2 (aliases optional). Examples: Nvidia: NVDA, $NVDA — or just Tesla if you only need one spelling.",
            "default": [
              "Nvidia: NVDA, $NVDA",
              "Bitcoin: BTC, $BTC",
              "Tesla: TSLA, $TSLA"
            ],
            "items": {
              "type": "string"
            }
          },
          "subreddits": {
            "title": "Subreddits (or all of Reddit)",
            "type": "array",
            "description": "Communities to scan (scan mode) and to scope search queries. Add a single entry all to search site-wide, or list subreddit names (e.g. stocks, wallstreetbets).",
            "default": [
              "stocks",
              "wallstreetbets"
            ],
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Discovery mode",
            "enum": [
              "search",
              "scan",
              "both"
            ],
            "type": "string",
            "description": "search = run queries through keyword search; scan = pull recent posts/comments from subreddits; both = maximum coverage.",
            "default": "both"
          },
          "stream": {
            "title": "Content to track",
            "enum": [
              "posts",
              "comments",
              "both"
            ],
            "type": "string",
            "description": "Which content types to include when matching your terms.",
            "default": "both"
          },
          "interval": {
            "title": "Trend bucket interval",
            "enum": [
              "hour",
              "day",
              "week"
            ],
            "type": "string",
            "description": "Time bucket size for mention volume and sentiment charts.",
            "default": "day"
          },
          "emitMentions": {
            "title": "Save per-mention rows",
            "type": "boolean",
            "description": "Output one dataset row for every matched post or comment with sentiment score and snippet.",
            "default": true
          },
          "emitAggregates": {
            "title": "Save trend buckets",
            "type": "boolean",
            "description": "Output chart-ready time-series rows (mentions, sentiment breakdown per bucket).",
            "default": true
          },
          "topN": {
            "title": "Top content per term",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Capture the top N posts/comments per term ranked by score and engagement.",
            "default": 10
          },
          "lexiconPreset": {
            "title": "Sentiment preset",
            "enum": [
              "general",
              "finance",
              "product"
            ],
            "type": "string",
            "description": "Built-in word list tuned for your use case. Finance adds bullish/bearish market slang.",
            "default": "finance"
          },
          "customLexiconEntries": {
            "title": "Custom sentiment words",
            "type": "array",
            "description": "Optional word:score pairs merged onto the preset. Score from -1 (negative) to 1 (positive). Example: moon:0.8, rug:-0.9",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "useLlmSentiment": {
            "title": "Use OpenAI sentiment (optional)",
            "type": "boolean",
            "description": "When enabled, uses OpenAI for higher-accuracy sentiment instead of the built-in lexicon.",
            "default": false
          },
          "openaiApiKey": {
            "title": "OpenAI API key",
            "type": "string",
            "description": "Required only when OpenAI sentiment is enabled above."
          },
          "searchQueries": {
            "title": "Search query overrides",
            "type": "array",
            "description": "Custom search queries for search mode. Leave empty to auto-build queries from your term aliases.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "hot",
              "top",
              "new",
              "comments"
            ],
            "type": "string",
            "description": "Sort order for keyword search results.",
            "default": "relevance"
          },
          "searchTime": {
            "title": "Search time window",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Limit search results to a recent time window.",
            "default": "week"
          },
          "resultsPerTerm": {
            "title": "Results per term (search)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many search results to examine per term (1–1000). Fetched in batches of 100.",
            "default": 100
          },
          "lookback": {
            "title": "Scan lookback",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many recent posts/comments to scan per subreddit in scan mode (1–1000). Fetched in batches of 100.",
            "default": 500
          },
          "minScore": {
            "title": "Minimum upvotes",
            "type": "integer",
            "description": "Skip items with fewer net upvotes than this. 0 keeps everything including brand-new posts.",
            "default": 0
          },
          "includeNsfw": {
            "title": "Include NSFW content",
            "type": "boolean",
            "description": "Include posts marked NSFW (over_18). Off by default.",
            "default": false
          },
          "ignoreKeywords": {
            "title": "Ignore keywords",
            "type": "array",
            "description": "Skip any post/comment containing one of these words (case-insensitive).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "subredditAllowlist": {
            "title": "Subreddit allowlist",
            "type": "array",
            "description": "If set, only keep matches from these subreddits.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "subredditDenylist": {
            "title": "Subreddit denylist",
            "type": "array",
            "description": "Never count matches from these subreddits.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "spikeThreshold": {
            "title": "Spike alert threshold",
            "type": "number",
            "description": "Fire a webhook when the latest bucket's mention count or absolute net sentiment crosses this value. 0 = disabled.",
            "default": 0
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. When set, spike alerts are POSTed here (Slack, Zapier, Make, or your own endpoint). All data is always saved to the dataset.",
            "default": ""
          },
          "webhookFormat": {
            "title": "Webhook format",
            "enum": [
              "json",
              "slack"
            ],
            "type": "string",
            "description": "Payload format for spike webhooks.",
            "default": "json"
          },
          "sinceId": {
            "title": "Since ID (incremental)",
            "type": "string",
            "description": "Optional item cursor — only emit matches newer than this ID. Scheduled runs also save cursors automatically.",
            "default": ""
          },
          "maxItems": {
            "title": "Max mention rows",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many mention rows. 0 = unlimited.",
            "default": 0
          },
          "includeRaw": {
            "title": "Include raw source data",
            "type": "boolean",
            "description": "Keep original source payloads during processing for debugging. Not included in output rows.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy settings",
            "type": "object",
            "description": "Use Apify Proxy with US Residential for best results. Leave the default unless you know you need something else.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}