# StockTwits Messages & Sentiment Scraper (`dataji/stocktwits-scraper`) Actor

Scrape public StockTwits messages for any ticker, crypto coin or user, no login: text, Bullish/Bearish sentiment, cashtags, likes, replies, price at post time and author stats. Date range, replies, daily sentiment aggregates and only-new mode. Error rows are free.

- **URL**: https://apify.com/dataji/stocktwits-scraper.md
- **Developed by:** [Dataji.io](https://apify.com/dataji) (community)
- **Categories:** Social media, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 messages

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 Messages & Sentiment Scraper

Get **public StockTwits messages** for any stock, ETF or crypto ticker, for any user, or for single message threads, with no login and no StockTwits account. Each message comes as a clean row with its text, the author's **Bullish / Bearish** label, the cashtags it mentions, likes, replies and reshares, the price of the ticker when it was posted, the author's **price target** when they set one, links, images and the author's public stats.

Turn on **daily sentiment aggregates** to get one row per ticker per whole day with message counts, Bullish and Bearish counts, the Bullish share and the other tickers people talked about.

**Error rows are free.** Tickers or users that don't exist, and requests StockTwits refuses, come back as error rows that cost nothing.

### What can this StockTwits scraper do?

- 💬 Scrape the message stream of **any ticker**: `AAPL`, `$TSLA`, `BRK.B`, ETFs and **crypto** (`BTC.X`, `ETH.X`, or plain `BTC` in the crypto field)
- 👤 Scrape the messages of **any user**, for example `Stocktwits`
- 🧵 Scrape **a message and all its replies** from a message link
- 🐂 Get the author's **Bullish / Bearish sentiment label**, and filter on it (Bullish only, Bearish only, or labeled only)
- 🎯 Get the author's **price target**: target price, Bullish or Bearish direction, target date and, once the date has passed, whether it was hit. Keep **only messages with a price target** if that is all you need; the rest are skipped for free
- 📅 Get messages from a **date range**: the actor jumps straight to your end date instead of paging through everything newer
- ↩️ Add the **replies** of each message as extra rows
- 📊 Get **daily sentiment aggregates** per ticker: messages, Bullish, Bearish, unlabeled, Bullish %, unique authors, top co-mentioned tickers. Only whole days by default, so the numbers of different days compare fairly
- 🔁 **Only new messages** mode for scheduled runs: each run returns only what was posted since the last one
- 💲 Get the **price at post time** for every ticker in the message
- 📦 Export to **JSON, CSV, Excel, XML or HTML**, or pull the data through the Apify API

### Why use this scraper?

- **Logged-out, public data only.** It reads the same data stocktwits.com shows any visitor who is not logged in. No account, no cookies, no API key.
- **Fair billing.** You pay per message row delivered and per daily aggregate row. Error rows, ticker info rows and messages your filters skip are free. A message that shows up in two of your tickers' streams (it mentions both) is delivered and charged once.
- **Every column, every time.** Every row has the same keys, with `null` where a key does not apply, so CSV and Excel exports always line up.
- **Restart-safe.** If the platform restarts a run, nothing is delivered or charged twice.

### How to scrape StockTwits

1. Click **Try for free**.
2. Enter one or more **tickers** (`AAPL`, `BTC.X`), **users** or **message links**.
3. Optionally set a date range, a sentiment or price target filter, replies or daily aggregates.
4. Click **Start** and download your data when the run finishes.

### Input

| Field | Description |
|---|---|
| **Tickers** | `AAPL`, `$TSLA`, `BRK.B`, `BTC.X`, or links like `https://stocktwits.com/symbol/NVDA`. Several on one line (`AAPL, MSFT`) also work. |
| **Crypto tickers** | Plain `BTC`, `ETH`, `SOL`: the actor adds StockTwits' `.X` suffix. (A plain `BTC` in **Tickers** is a Bitcoin ETF on StockTwits, not the coin.) |
| **Users** | `Stocktwits`, `@Stocktwits` or `https://stocktwits.com/Stocktwits` |
| **Message links** | `https://stocktwits.com/<user>/message/<id>` or just the id: the message and its replies |
| **Max messages per ticker, user or link** | Default 200. Counts messages that pass your filters, newest first. Replies come on top. |
| **Messages from / to** | `2026-11-01`, `2026-11-01T14:30:00Z` or relative (`7 days`, `12 hours`). Times are UTC; a plain "to" date includes the whole day. |
| **Sentiment** | All (default), Bullish only, Bearish only, or labeled only (Bullish or Bearish) |
| **Only messages with a price target** | Off by default. Keeps only messages where the author set a price target; the others are skipped and not charged. Price targets are rare, so each ticker or user stream stops after reading 5,000 messages. |
| **Include replies** | Off by default. Adds up to 100 replies per message as rows right after it. |
| **Daily sentiment aggregates** | Off by default. One row per ticker per whole day (UTC). Today, and the oldest day if the run stopped inside it, are left out. |
| **Include partial days** | Off by default. Also returns the days the run did not read completely, marked `isPartialDay: true`. |
| **Only new messages** | Off by default. For schedules: returns only messages newer than the last run's newest. |
| **Max concurrency** | Default 3. How many tickers, users or links are read at the same time. |
| **Proxy configuration** | US residential Apify Proxy by default. StockTwits often refuses datacenter IPs (HTTP 403). The API answers are small, so residential traffic costs little. |

Example input:

```json
{
    "symbols": ["AAPL", "TSLA"],
    "cryptoSymbols": ["BTC"],
    "usernames": ["Stocktwits"],
    "maxMessagesPerTarget": 500,
    "dateFrom": "7 days",
    "sentimentFilter": "all",
    "includeReplies": false,
    "dailyAggregates": true
}
```

### Output example

Every row has a `recordType`: `message`, `dailyAggregate`, `symbolInfo` or `error`. Every row has every key; keys that don't apply to a row type are `null` and are left out of the examples below.

A message:

```json
{
    "recordType": "message",
    "input": "Stocktwits",
    "source": { "type": "user", "value": "Stocktwits" },
    "id": 669359890,
    "url": "https://stocktwits.com/Stocktwits/message/669359890",
    "body": "$SPY Checking my portfolio",
    "createdAt": "2026-11-17T16:59:22Z",
    "sentiment": null,
    "symbols": [{ "symbol": "SPY", "title": "SPDR S&P 500 ETF Trust" }],
    "cashtags": ["SPY"],
    "mentionedUsers": [],
    "likesCount": 19,
    "repliesCount": 2,
    "resharesCount": 0,
    "links": [],
    "media": [
        {
            "type": "image",
            "url": "https://media.stocktwits-cdn.com/api/3/media/15678460/original.png",
            "thumbnailUrl": "https://media.stocktwits-cdn.com/api/3/media/15678460/thumb.webp",
            "provider": null,
            "width": 680,
            "height": 577
        }
    ],
    "priceAtPost": null,
    "pricesAtPost": [{ "symbol": "SPY", "price": 730.89 }],
    "priceTarget": null,
    "priceTargetSymbol": null,
    "priceTargetDirection": null,
    "priceTargetDate": null,
    "priceTargetStatus": null,
    "priceTargetHit": null,
    "priceTargetFinalPrice": null,
    "isReply": false,
    "parentId": null,
    "inReplyToId": null,
    "reshareOf": null,
    "author": {
        "id": 170,
        "username": "Stocktwits",
        "name": "Stocktwits",
        "followers": 941440,
        "following": 10220,
        "ideas": 139191,
        "joinDate": "2009-08-31",
        "official": true,
        "avatarUrl": "https://avatars.stocktwits.com/production/170/thumb-1737498389.png"
    },
    "scrapedAt": "2026-11-18T02:08:30+00:00"
}
```

The price target fields of a message whose author set one (an AAPL message from 2026-10-21; the other fields are as above):

```json
{
    "priceAtPost": 337.31,
    "priceTarget": 313.0,
    "priceTargetSymbol": "AAPL",
    "priceTargetDirection": "Bearish",
    "priceTargetDate": "2026-10-29",
    "priceTargetStatus": "completed",
    "priceTargetHit": false,
    "priceTargetFinalPrice": 348.93
}
```

A daily aggregate (from a live test run on 2026-11-18 with **Include partial days** on and a limit of 40 messages, so the day is partial):

```json
{
    "recordType": "dailyAggregate",
    "input": "AAPL",
    "source": { "type": "symbol", "value": "AAPL" },
    "symbol": "AAPL",
    "date": "2026-11-17",
    "messages": 24,
    "bullish": 6,
    "bearish": 4,
    "unlabeled": 14,
    "bullishPct": 60.0,
    "uniqueAuthors": 19,
    "topCashtagsMentioned": [
        { "symbol": "NVDA", "count": 11 },
        { "symbol": "QQQ", "count": 9 },
        { "symbol": "SPY", "count": 9 },
        { "symbol": "NFLX", "count": 3 },
        { "symbol": "DELL", "count": 2 }
    ],
    "isPartialDay": true,
    "scrapedAt": "2026-11-18T02:08:44+00:00"
}
```

Ticker info (one free row per ticker):

```json
{
    "recordType": "symbolInfo",
    "input": "BTC",
    "source": { "type": "symbol", "value": "BTC.X" },
    "symbol": "BTC.X",
    "title": "Bitcoin",
    "exchange": "CRYPTO",
    "region": "X",
    "instrumentClass": "CRYPTO",
    "watchlistCount": 687677,
    "logoUrl": "https://logos.stocktwits-cdn.com/BTC.X.webp",
    "symbolUrl": "https://stocktwits.com/coins/bitcoin",
    "scrapedAt": "2026-11-18T02:08:07+00:00"
}
```

An error (free):

```json
{
    "recordType": "error",
    "input": "ZZZQXJ",
    "source": { "type": "symbol", "value": "ZZZQXJ" },
    "error": "notFound",
    "errorMessage": "StockTwits has no symbol 'ZZZQXJ' (Symbol not found).",
    "scrapedAt": "2026-11-18T02:08:07+00:00"
}
```

### Output fields

| Field | Description |
|---|---|
| `recordType` | `message`, `dailyAggregate`, `symbolInfo` or `error` |
| `input` | What you entered, unchanged |
| `source` | Where the row came from: `{"type": "symbol" \| "user" \| "thread", "value": "AAPL"}` |
| `id`, `url` | Message id and link |
| `body` | Message text (HTML entities decoded) |
| `createdAt` | When it was posted (UTC, ISO 8601) |
| `sentiment` | `Bullish`, `Bearish`, or `null` when the author set no label (most messages) |
| `symbols` | Tickers StockTwits attached to the message: `[{"symbol", "title"}]` |
| `cashtags` | All `$TICKERS` in the text |
| `mentionedUsers` | Usernames mentioned with `@` |
| `likesCount`, `repliesCount`, `resharesCount` | Counters at the time of scraping |
| `links`, `media` | Links with title and site; images, GIFs and charts with their URLs |
| `priceAtPost` | Price of the scraped ticker when the message was posted (ticker streams only) |
| `pricesAtPost` | Price of every ticker in the message at post time |
| `priceTarget`, `priceTargetSymbol` | The author's target price and the ticker it is for, `null` when the author set none (most messages) |
| `priceTargetDirection` | `Bullish` (target above the price at post time) or `Bearish` (below) |
| `priceTargetDate` | The date (US market close) by which the author expects the target to be reached |
| `priceTargetStatus` | `active` until the target date, then `completed` |
| `priceTargetHit`, `priceTargetFinalPrice` | Once completed: whether the target was hit, and the price on the target date |
| `isReply`, `parentId`, `inReplyToId` | Whether the message is a reply, the thread's first message, and the message it answers |
| `reshareOf` | For a reshare: `{"id", "url"}` of the original message |
| `author` | `{"id", "username", "name", "followers", "following", "ideas", "joinDate", "official", "avatarUrl"}` |
| `symbol`, `title`, `exchange`, `region`, `instrumentClass`, `watchlistCount`, `logoUrl`, `symbolUrl` | Ticker info rows (and `symbol` on aggregate rows) |
| `date` | Aggregate day (UTC) |
| `messages`, `bullish`, `bearish`, `unlabeled` | Messages read that day, and how many carry each label |
| `bullishPct` | Bullish share of the labeled messages (`bullish / (bullish + bearish)`, in %), `null` with no labels |
| `uniqueAuthors` | Distinct authors that day |
| `topCashtagsMentioned` | Up to 5 other tickers mentioned most that day: `[{"symbol", "count"}]` |
| `isPartialDay` | `true` when the run did not read the whole day (today, the run stopped inside the day at your message limit, or the day is where the visible history ends). Such days are only returned with **Include partial days** |
| `scrapedAt` | When the row was made (UTC) |
| `error`, `errorMessage` | `null` except on error rows: the code and the reason (see FAQ) |

The **Messages**, **Price targets**, **Daily sentiment**, **Tickers** and **Errors** tabs in the run's **Output** show the most useful columns.

### Pricing

This actor uses **pay per event** pricing: you pay for the rows you get, and the price drops on higher Apify plans.

| Event | Charged for | Free plan | Bronze | Silver | Gold |
|---|---|---|---|---|---|
| `message` | 1,000 message rows, replies included | $0.70 | $0.60 | $0.45 | $0.35 |
| `aggregate` | 1 daily aggregate row | $0.002 | $0.002 | $0.0015 | $0.001 |

For example:

- **10,000 messages** for a set of tickers cost **$7.00** on the free plan, or **$3.50** on Gold.
- **30 days of daily sentiment** for 5 tickers (150 aggregate rows) cost **$0.30** on the free plan, plus the messages read for them.

Ticker info rows, error rows and messages skipped by your filters are **never charged**. Proxy costs are included. The run stops cleanly at the spending limit you set, and the status message says how many targets were not finished.

### Use cases

- **Retail sentiment tracking**: daily Bullish / Bearish counts per ticker, for dashboards or as a trading signal input
- **Event studies**: what StockTwits said around earnings, launches or news, with `priceAtPost` for each message
- **Crypto community monitoring**: `BTC.X`, `ETH.X`, `SOL.X` and more
- **Research datasets**: message text with author labels for NLP and sentiment models
- **Scheduled monitoring**: run every hour with **Only new messages** and send new rows to Google Sheets, Slack or a webhook

### FAQ

#### Do I need a StockTwits account?

No. The actor reads only what stocktwits.com shows to visitors who are not logged in. It never logs in and uses no cookies or keys.

#### How far back can I go?

Logged out, StockTwits shows about the **last 12 months** of a stream. On 2026-11-18 the AAPL stream still had messages from 2025-11-20, while pages from early October 2025 came back empty. A date range further back returns nothing for the older part.

#### Can I search StockTwits by keyword?

No. Keyword search needs a logged-in account on StockTwits, so it is not available. Use tickers, users and message links.

#### How does the date range work?

`dateTo` makes the actor jump close to that moment (a few small requests) instead of reading every newer message, then it reads backwards until `dateFrom`, your message limit, or the end of the visible history. Times are UTC.

#### Why did I get fewer daily aggregate days than expected?

The aggregates are computed from the messages this run read, and by default only **whole days** are returned. A day is whole only when the run read all of it: today is never whole, and the oldest day is not whole when the run stopped at **Max messages** inside it, when **Messages from** starts in the middle of it (relative dates like `7 days` do), or when it is the oldest day StockTwits still shows (the visible history ends in the middle of a day). Those days are left out and not charged; the run's log names them.

To get more whole days, set **Messages from** to a plain date (it starts at midnight UTC) and set **Max messages** above the number of messages in that period. Busy tickers such as AAPL, TSLA or NVDA get hundreds to thousands of messages a day. Turn on **Include partial days** to also get the incomplete days, marked `isPartialDay: true`.

#### How do price targets work?

On StockTwits an author can attach a price prediction to a message: a target price for one ticker and a date. The actor returns it in the `priceTarget` fields. Price targets are rare: in about 700 messages we sampled on 2026-11-18, two had one. With **Only messages with a price target** on, each ticker or user stream is read until **Max messages** price target messages are found, the date range or visible history ends, or 5,000 messages were read; the skipped messages are free. To look further back, set **Messages to**.

#### What does "Only new messages" remember?

The newest message id per ticker and user, in a key-value store named `stocktwits-seen` in your Apify account. It is only updated when a ticker or user was read to the end of what you asked for (date, limit or history), so a failed run does not skip messages next time. Set **Max messages** high enough for the time between runs.

#### Which inputs fail, and why?

Each failed input gets one free error row with an `error` code:

| Code | Meaning |
|---|---|
| `notFound` | The ticker, user or message does not exist on StockTwits (or the message was deleted). |
| `blocked` | StockTwits refused the request, or did not answer after 3 tries on 3 proxy IPs. Rows already delivered for that target stay. Try again later or with residential proxies. |
| `invalidInput` | Not a ticker, username or message link, for example a coin page link (use `BTC.X`) or a link to another site. |
| `failed` | An unexpected problem. Please report it in the **Issues** tab. |

#### Can I use it through the API?

Yes. You can start runs and download results with the [Apify API](https://docs.apify.com/api/v2), the Apify JavaScript and Python clients, or integrations like Make, Zapier and Google Sheets.

### Is it legal to scrape StockTwits?

This actor only collects messages that StockTwits shows publicly to visitors who are not logged in. Still, please use the data responsibly:

- **Personal data.** Messages are written by people, and usernames, display names and avatars are personal data under the **GDPR** (EU and UK) and similar laws. Collect only what you need, have a lawful basis such as legitimate interest, keep it secure, and honour people's rights, including the right to object and to erasure. Aggregated statistics (like the daily aggregates) are the privacy-friendliest way to use the data.
- **Not investment advice.** Messages and sentiment labels are opinions of StockTwits users. Nothing in the output is financial advice.
- **StockTwits' terms.** StockTwits' terms restrict automated collection and reuse of content. You are responsible for how you use this actor and the data.

You can read more in Apify's blog post on [the legality of web scraping](https://blog.apify.com/is-web-scraping-legal/), and check with a lawyer if you are unsure.

**Removal requests.** If your information appears in output from this actor and you want it removed, or have a privacy question, email **privacy@dataji.io**. We aim to answer within 30 days.

### Need something custom?

This actor is one of many data tools we build at Dataji. If you need something different, we can build it for you, whether that's a change to this actor or a scraper for any other website or data source.

Popular requests include:

- sentiment from several sources (StockTwits, Reddit, news) combined into one daily score
- extra fields, filters or alerts, such as notifications when a ticker's Bullish share jumps
- scheduled runs that deliver straight to Google Sheets, a database or a webhook

These are only examples. If the data is online, we can most likely collect it for you. Tell us what you're trying to build through the [contact form](https://dataji.io/contact-us/) or email support@dataji.io. For bugs or questions about this actor, please use the **Issues** tab.

### Support

Found a bug or need a field that is missing? Open an issue in the **Issues** tab and we'll take a look.

# Changelog

This Actor's version history is a separate document: https://apify.com/dataji/stocktwits-scraper/changelog.md

# Actor input Schema

## `symbols` (type: `array`):

Stock, ETF or crypto tickers whose message streams you want, one per line: AAPL, $TSLA, BRK.B, BTC.X (StockTwits writes crypto with .X), or symbol links such as https://stocktwits.com/symbol/NVDA. Duplicates are removed.

## `cryptoSymbols` (type: `array`):

Plain crypto tickers such as BTC, ETH or SOL. The actor adds StockTwits' .X suffix for you (BTC becomes BTC.X). A plain BTC in Tickers is a different instrument on StockTwits (an ETF).

## `usernames` (type: `array`):

StockTwits users whose own messages you want: Stocktwits, @Stocktwits or https://stocktwits.com/Stocktwits.

## `messageUrls` (type: `array`):

Single messages to scrape together with their replies: https://stocktwits.com/<user>/message/<id>, or just the message id.

## `maxMessagesPerTarget` (type: `integer`):

Stop each ticker or user stream after this many messages that pass your filters (newest first). Replies fetched with 'Include replies' come on top. For a message link this caps the message plus its replies.

## `dateFrom` (type: `string`):

Only messages posted on or after this moment (UTC): 2026-11-01, 2026-11-01T14:30:00Z, or relative like '7 days' or '12 hours'. Logged-out StockTwits shows about the last 12 months.

## `dateTo` (type: `string`):

Only messages posted on or before this moment (UTC). A plain date includes the whole day. The actor jumps straight to this date instead of paging through newer messages.

## `sentimentFilter` (type: `string`):

Keep all messages, only those the author tagged Bullish or Bearish, or only tagged ones (either label). Most messages carry no label.

## `onlyWithPriceTarget` (type: `boolean`):

Keep only messages in which the author set a price target (a price and a date, with Bullish or Bearish direction; see the priceTarget fields). Other messages are skipped and not charged. Price targets are rare (a few per 1,000 messages), so each ticker or user stream stops after reading 5,000 messages; use 'Messages to' to look further back.

## `includeReplies` (type: `boolean`):

For messages that have replies, also fetch the replies (up to 100 per message) and add them as rows right after the message. Replies are charged like messages.

## `dailyAggregates` (type: `boolean`):

Add one row per ticker per day (UTC) with message, Bullish and Bearish counts, Bullish share, unique authors and the other tickers mentioned most, counted from the messages this run reads. Only whole days are returned: today, and the oldest day when the run stopped inside it, are left out (see 'Include partial days'). Sizing: busy tickers such as AAPL, TSLA or NVDA get hundreds to thousands of messages a day, so for whole days set 'Max messages' well above days x daily messages, or set 'Messages from' to a plain date (it starts at midnight UTC).

## `includePartialDays` (type: `boolean`):

Also return the days this run did not read completely (today, and the oldest day when the run stopped at 'Max messages' or the visible history ended inside it), marked isPartialDay: true. Their counts are lower than the full day's. Each row is charged like any other aggregate row.

## `onlyNewMessages` (type: `boolean`):

For scheduled runs: remember the newest message per ticker and user (in the key-value store 'stocktwits-seen' of your account) and next time return only messages posted after it.

## `maxConcurrency` (type: `integer`):

How many tickers, users or links are read at the same time, each through its own proxy IP.

## `proxyConfiguration` (type: `object`):

US residential Apify Proxy is used by default. On 18 Nov 2026 StockTwits refused datacenter IPs (HTTP 403) for 3 of 5 targets, while residential IPs got all of them.

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "TSLA"
  ],
  "maxMessagesPerTarget": 200,
  "sentimentFilter": "all",
  "onlyWithPriceTarget": false,
  "includeReplies": false,
  "dailyAggregates": false,
  "includePartialDays": false,
  "onlyNewMessages": false,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

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

Messages, ticker info, daily aggregates and error rows (recordType says which).

## `messages` (type: `string`):

Messages with sentiment, cashtags, counters and author.

## `priceTargets` (type: `string`):

Messages with the author's price target, direction and target date.

## `dailyAggregates` (type: `string`):

One row per ticker per day, when 'Daily sentiment aggregates' is on.

## `errors` (type: `string`):

Why an input failed (not found, blocked, invalid input). Error rows are free.

# 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 = {
    "symbols": [
        "AAPL",
        "TSLA"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dataji/stocktwits-scraper").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 = {
    "symbols": [
        "AAPL",
        "TSLA",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("dataji/stocktwits-scraper").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 '{
  "symbols": [
    "AAPL",
    "TSLA"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call dataji/stocktwits-scraper --silent --output-dataset

```

## MCP server setup

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

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/LXRm3pfaTUdE4rLj5/builds/NZhoQ6J80qGRVYqRT/openapi.json
