# Stocktwits Sentiment & Retail Flow Analyzer (`quanmatrix/stocktwits-sentiment-flow-intelligence`) Actor

Turn Stocktwits-style message datasets into ticker sentiment shifts, retail attention, volume breakouts and deterministic watch signals.

- **URL**: https://apify.com/quanmatrix/stocktwits-sentiment-flow-intelligence.md
- **Developed by:** [Rafael Barreto Haddad](https://apify.com/quanmatrix) (community)
- **Categories:** Social media, News, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Stocktwits Sentiment & Retail Flow Analyzer

Turn Stocktwits-style message datasets into ticker sentiment shifts, retail attention, volume breakouts and deterministic watch signals.

### Why use this Actor

Stocktwits messages are easy to collect, but researchers need recurring ticker-level intelligence about sentiment shifts, attention breakouts and retail-flow changes rather than another raw message feed.

### Key features

- Buyer-native inputs aligned to **stocktwits sentiment**.
- Predictable structured output in the default Apify Dataset.
- Pay Per Event pricing tied to measurable result rows or reports.
- Optional MCP connector delivery for downstream automation and AI agents.

### Quick start

Start with this working example and replace the target values with your own:

```json
{
  "currentItems": [
    {
      "id": "m1",
      "symbol": "NVDA",
      "sentiment": "Bullish",
      "body": "NVDA breakout and strong upside, bullish long setup",
      "likes": 12,
      "replies": 3
    },
    {
      "id": "m2",
      "symbol": "NVDA",
      "sentiment": "Bullish",
      "body": "NVDA momentum",
      "likes": 8
    },
    {
      "id": "m3",
      "symbol": "TSLA",
      "sentiment": "Bearish",
      "body": "TSLA downside risk and bearish breakdown, short pressure",
      "likes": 10,
      "replies": 2
    },
    {
      "id": "m4",
      "symbol": "AAPL",
      "sentiment": "Bullish",
      "body": "AAPL constructive",
      "likes": 2
    }
  ],
  "previousItems": [
    {
      "id": "p1",
      "symbol": "NVDA",
      "sentiment": "Bearish",
      "body": "NVDA bearish",
      "likes": 3
    },
    {
      "id": "p2",
      "symbol": "TSLA",
      "sentiment": "Bullish",
      "body": "TSLA bullish",
      "likes": 4
    }
  ],
  "watchTickers": [
    "NVDA"
  ]
}
```

The Actor writes structured results to the default Apify Dataset and can be used from the Store, API, schedules, Tasks, automations and MCP-compatible AI workflows.

### Input

- `currentItems` — Current message rows: Current Stocktwits or normalized market-message rows.
- `currentDatasetId` — Current Apify Dataset ID: Optional Apify Dataset with current messages.
- `previousDatasetId` — Previous Apify Dataset ID: Optional prior Apify Dataset.
- `watchTickers` — Watch tickers: Tickers to prioritize in agent actions.
- `maxItems` — Maximum input rows: Maximum number of input rows loaded and analyzed in this run.

All integration and advanced analysis fields are optional. The default example is intentionally runnable without configuring MCP or a previous-run baseline.

### Output

The Dataset exposes predictable machine-readable output. Representative fields include `results`, `report`.

### Pricing

This Actor uses Pay Per Event. The current factory base price is **$0.010000 per result event**. The Apify Store remains the source of truth for the price and plan/tier details shown to the buyer.

### Use cases

- Run the buyer-ready workflows exposed as Apify Tasks without preparing a custom integration first.
- Use the Actor from API or schedules for recurring collection, comparison or monitoring.
- Feed the structured Dataset output into spreadsheets, databases, automations or AI agents.
- Compare repeat runs when the product supports snapshots or previous-run inputs.

### Automation and AI

Use the same Actor through Apify API, schedules, public Tasks and the Apify MCP server. Outputs are structured for downstream workflows and AI agents rather than requiring manual copy/paste.

### Limitations

- Public websites and upstream APIs can change markup, access rules, rate limits or field availability without notice.
- Fields that are not publicly available are returned as unavailable or omitted rather than fabricated.
- Analytical outputs depend on the quality and coverage of the supplied or collected source data.
- Treat marketplace, reputation, workforce, safety or commercial signals as decision support and validate material decisions against the underlying source evidence.

### Detailed documentation

### Detailed documentation

### Why use this Actor

Use this Actor when raw upstream records are not enough and you need a compact, repeatable intelligence layer with deterministic change signals.

### Key features

The product normalizes public upstream data, compares optional previous snapshots, aggregates decision-relevant signals, writes one compact report to the Dataset, and stores a reusable snapshot in the Key-Value Store.

### Example

Run the default example input from the Actor console. It uses a small synthetic current/previous sample so the output shows change detection, aggregated scores, and `agentAction` without requiring credentials.

### Use cases

Scheduled monitoring, research dashboards, AI-agent tools, data pipelines, webhook workflows, and analyst review queues.

### Pricing

Pay per primary intelligence result. One run produces one decision-ready report; pricing is tied to the analytical outcome rather than charging separately for every derived table inside the report.

### Limitations

The Actor analyzes the supplied public-data sample. Coverage depends on upstream data completeness, and derived scores describe observed patterns rather than guaranteeing real-world outcomes.

Turn Stocktwits-style message datasets into ticker-level sentiment and attention intelligence. This Actor is not another social scraper. It is designed to sit downstream from a Stocktwits data source, compare periods, and identify which symbols are gaining attention, changing sentiment, or showing unusual message-volume behavior.

### What it does

Provide current messages directly or select an Apify Dataset. Add a previous dataset when you want period-over-period intelligence. The Actor normalizes common ticker, sentiment, message and engagement fields, then aggregates them by symbol.

For each ticker it calculates message count, bullish and bearish label counts, a normalized sentiment index, mention share, engagement, mention growth, sentiment shift and a deterministic breakout score. It also identifies sentiment reversals and attention breakouts.

### Intelligence produced

- bullish versus bearish pressure by ticker;
- prior-period sentiment change;
- mention growth and attention share;
- engagement change;
- breakout scoring based on attention, sentiment movement and volume growth;
- watchlist prioritization;
- deterministic actions such as `SENTIMENT_REVERSAL`, `BULLISH_BREAKOUT`, `BEARISH_BREAKOUT`, `VOLUME_BREAKOUT`, `WATCHLIST_REVIEW` and `MONITOR`;
- reusable normalized snapshots for recurring Tasks.

### Input flexibility

The Actor accepts `currentItems` or `currentDatasetId`, plus optional previous rows or a previous Dataset. It recognizes common fields such as `symbol`, `ticker`, `symbols`, `sentiment`, `body`, `text`, `likes`, `replies`, and related aliases.

When an upstream source already supplies bullish/bearish labels, those labels are used. When no label exists, a deliberately conservative lexical fallback may classify only strongly directional messages; weak text stays `UNLABELED` rather than being forced into a sentiment bucket.

### Why this is different

A Stocktwits scraper solves extraction. This Actor solves the next problem: deciding what changed across a market-message batch. The primary output is one compact intelligence report rather than thousands of raw messages. That is useful for scheduled monitoring, dashboards, AI-agent tools, research notebooks, webhook alerts and market-news workflows.

### Responsible interpretation

Retail-message sentiment can be noisy, coordinated, ironic, delayed or unrelated to future price movement. `sentimentIndex`, `breakoutScore` and `agentAction` describe patterns in the supplied public-message sample. They do not predict returns, certify market manipulation or constitute investment advice.

### Automation

Run the Actor after your Stocktwits data-collection Task, pass the newest Dataset as current input and the prior Dataset as baseline, then route the single report to Slack, Sheets, a database, an AI agent or your own alerting logic.

# Changelog

This Actor's version history is a separate document: https://apify.com/quanmatrix/stocktwits-sentiment-flow-intelligence/changelog.md

# Actor input Schema

## `currentItems` (type: `array`):

Current Stocktwits or normalized market-message rows.

## `currentDatasetId` (type: `string`):

Optional Apify Dataset with current messages.

## `previousItems` (type: `array`):

Optional prior message rows.

## `previousDatasetId` (type: `string`):

Optional prior Apify Dataset.

## `watchTickers` (type: `array`):

Tickers to prioritize in agent actions.

## `maxItems` (type: `integer`):

Maximum number of input rows loaded and analyzed in this run.

## `mcpConnectors` (type: `array`):

Optional MCP connectors authorized in your Apify account. Use them to send or write this Actor result to tools such as Slack, Notion, GitHub, Sentry, Supabase, or another compatible MCP service.

## `mcpToolName` (type: `string`):

Optional exact MCP tool name. Leave blank to let the selected MCP action preset discover a compatible tool automatically.

## `mcpToolArguments` (type: `object`):

JSON object passed to the selected MCP tool. String values may use {{actor_title}}, {{result_summary}}, or {{result_json}} placeholders.

## `mcpFailOnError` (type: `boolean`):

When enabled, an MCP delivery error fails the Actor run. Disabled by default so data extraction and intelligence results remain available even if the external destination is unavailable.

## `mcpActionPreset` (type: `string`):

Choose a safe action pattern. AUTO_SAFE_WRITE discovers a compatible non-destructive write tool automatically; use a specific preset for Slack, GitHub, Notion, or database delivery.

## Actor input object example

```json
{
  "currentItems": [
    {
      "id": "m1",
      "symbol": "NVDA",
      "sentiment": "Bullish",
      "body": "NVDA breakout and strong upside, bullish long setup",
      "likes": 12,
      "replies": 3
    },
    {
      "id": "m2",
      "symbol": "NVDA",
      "sentiment": "Bullish",
      "body": "NVDA momentum",
      "likes": 8
    },
    {
      "id": "m3",
      "symbol": "TSLA",
      "sentiment": "Bearish",
      "body": "TSLA downside risk and bearish breakdown, short pressure",
      "likes": 10,
      "replies": 2
    },
    {
      "id": "m4",
      "symbol": "AAPL",
      "sentiment": "Bullish",
      "body": "AAPL constructive",
      "likes": 2
    }
  ],
  "previousItems": [
    {
      "id": "p1",
      "symbol": "NVDA",
      "sentiment": "Bearish",
      "body": "NVDA bearish",
      "likes": 3
    },
    {
      "id": "p2",
      "symbol": "TSLA",
      "sentiment": "Bullish",
      "body": "TSLA bullish",
      "likes": 4
    }
  ],
  "watchTickers": [],
  "maxItems": 20000,
  "mcpToolName": "",
  "mcpToolArguments": {},
  "mcpFailOnError": false,
  "mcpActionPreset": "AUTO_SAFE_WRITE"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `report` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "currentItems": [
        {
            "id": "m1",
            "symbol": "NVDA",
            "sentiment": "Bullish",
            "body": "NVDA breakout and strong upside, bullish long setup",
            "likes": 12,
            "replies": 3
        },
        {
            "id": "m2",
            "symbol": "NVDA",
            "sentiment": "Bullish",
            "body": "NVDA momentum",
            "likes": 8
        },
        {
            "id": "m3",
            "symbol": "TSLA",
            "sentiment": "Bearish",
            "body": "TSLA downside risk and bearish breakdown, short pressure",
            "likes": 10,
            "replies": 2
        },
        {
            "id": "m4",
            "symbol": "AAPL",
            "sentiment": "Bullish",
            "body": "AAPL constructive",
            "likes": 2
        }
    ],
    "previousItems": [
        {
            "id": "p1",
            "symbol": "NVDA",
            "sentiment": "Bearish",
            "body": "NVDA bearish",
            "likes": 3
        },
        {
            "id": "p2",
            "symbol": "TSLA",
            "sentiment": "Bullish",
            "body": "TSLA bullish",
            "likes": 4
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("quanmatrix/stocktwits-sentiment-flow-intelligence").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "currentItems": [
        {
            "id": "m1",
            "symbol": "NVDA",
            "sentiment": "Bullish",
            "body": "NVDA breakout and strong upside, bullish long setup",
            "likes": 12,
            "replies": 3,
        },
        {
            "id": "m2",
            "symbol": "NVDA",
            "sentiment": "Bullish",
            "body": "NVDA momentum",
            "likes": 8,
        },
        {
            "id": "m3",
            "symbol": "TSLA",
            "sentiment": "Bearish",
            "body": "TSLA downside risk and bearish breakdown, short pressure",
            "likes": 10,
            "replies": 2,
        },
        {
            "id": "m4",
            "symbol": "AAPL",
            "sentiment": "Bullish",
            "body": "AAPL constructive",
            "likes": 2,
        },
    ],
    "previousItems": [
        {
            "id": "p1",
            "symbol": "NVDA",
            "sentiment": "Bearish",
            "body": "NVDA bearish",
            "likes": 3,
        },
        {
            "id": "p2",
            "symbol": "TSLA",
            "sentiment": "Bullish",
            "body": "TSLA bullish",
            "likes": 4,
        },
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("quanmatrix/stocktwits-sentiment-flow-intelligence").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "currentItems": [
    {
      "id": "m1",
      "symbol": "NVDA",
      "sentiment": "Bullish",
      "body": "NVDA breakout and strong upside, bullish long setup",
      "likes": 12,
      "replies": 3
    },
    {
      "id": "m2",
      "symbol": "NVDA",
      "sentiment": "Bullish",
      "body": "NVDA momentum",
      "likes": 8
    },
    {
      "id": "m3",
      "symbol": "TSLA",
      "sentiment": "Bearish",
      "body": "TSLA downside risk and bearish breakdown, short pressure",
      "likes": 10,
      "replies": 2
    },
    {
      "id": "m4",
      "symbol": "AAPL",
      "sentiment": "Bullish",
      "body": "AAPL constructive",
      "likes": 2
    }
  ],
  "previousItems": [
    {
      "id": "p1",
      "symbol": "NVDA",
      "sentiment": "Bearish",
      "body": "NVDA bearish",
      "likes": 3
    },
    {
      "id": "p2",
      "symbol": "TSLA",
      "sentiment": "Bullish",
      "body": "TSLA bullish",
      "likes": 4
    }
  ]
}' |
apify call quanmatrix/stocktwits-sentiment-flow-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,quanmatrix/stocktwits-sentiment-flow-intelligence"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/42gePSmhe0Aja9fhs/builds/YKFIA1dgvMoymdw7G/openapi.json
