How do I add social media sentiment to my trading bot?

Pull per-ticker buzz, sentiment and mentions from Reddit and X once a day. Use each day's values only after that UTC day has closed. Feed them to the bot as a filter or feature next to price. Do not let sentiment trigger trades on its own. An ESMA study of EU stocks found only a short-lived effect of social media sentiment on returns, so test any rule out of sample first.

10 min read

The short answer

  • Role: a filter or feature next to price, not the trigger
  • Data: buzz, sentiment and mentions per ticker, per source, per UTC day
  • Timing: use a day's numbers only after that UTC day has closed
  • Budget: each call is 1 request. The free 250 a month covers a test, not a live bot
Daily snapshot, 3 tickers on Reddit and X
6 requests
Tickers per compare call
Up to 10
Free tier
250 requests/month
Hobby tier
250,000 requests/month

Not investment advice. The numbers on this page describe attention and sentiment on social media. They do not tell you what to buy or sell.

Should sentiment trigger trades or filter them?

Filter them. Social sentiment works best as one input next to price and risk rules, not as the signal that opens a position.

The evidence for a direct trading edge is thin. ESMA published a study of social media sentiment and EU stock prices in April 2024. It found "only a transitory effect of social media sentiment on stock excess returns". Price overreaction "typically does not last more than one day". FINRA warns that information from social sentiment tools "may be inaccurate, incomplete or misleading". It adds that people can use posts to manipulate a stock's price and that stale data hurts these tools.

The sources also disagree with each other. On November 28, 2026 Reddit sentiment was slightly negative for NVDA, TSLA and AAPL. X sentiment was positive for all three. A bot that averages the two hides that split.

Three roles fit that evidence:

  • A veto. Skip new entries when attention jumps far above a ticker's normal level and the crowd is one-sided.
  • A universe filter. Trade only names with enough mentions for the score to mean something. A sentiment score built on a dozen posts is noise.
  • A model feature. Add buzz, sentiment and mention change as columns next to returns, volume and volatility. Then let the backtest show whether they add anything.

Which sentiment fields should a bot pull?

Pull attention and direction per ticker, per source, per UTC day. In the Adanos API these are the fields of the stock endpoint of each source, for example /reddit/stocks/v1/stock/{ticker} and /x/stocks/v1/stock/{ticker}:

  • buzz_score, 0 to 100, measures attention on that one source.
  • sentiment_score, -1 to +1, plus bullish_pct and bearish_pct, give the direction of the talk.
  • mentions is the raw count. Use it to judge whether the score rests on enough posts.
  • trend is rising, falling or stable, from the last 3 days against the 3 before.
  • daily_trend has one row per UTC day with the fields above.

Two more endpoints save requests. /compare returns up to 10 tickers in one request for a window. With from and to set to the same day it returns that day's values. Our test for November 28 matched the daily_trend rows exactly. /trending returns the most-discussed tickers in one request. Use it to pick a universe.

Each source has its own base path. There is no merged endpoint, so a bot keeps one column per source. The X Top 100 and Reddit Top 100 pages show the same numbers without a key. Use them to check what the bot sees.

What does a daily feature frame look like in Python?

The script below builds 14 days of Reddit and X features for NVDA, TSLA and AAPL. It ends at the last full UTC day, caches each response on disk and prints the latest row per ticker. A first run makes 6 requests. A rerun on the same day makes none.

Terminal
pip install requests pandas
export ADANOS_API_KEY=your_key
Code
# features.py: daily Reddit and X sentiment features for a trading bot
import json
import os
from datetime import datetime, timedelta, timezone
from pathlib import Path

import pandas as pd
import requests

API = "https://api.adanos.com"
HEADERS = {"X-API-Key": os.environ["ADANOS_API_KEY"]}
TICKERS = ["NVDA", "TSLA", "AAPL"]
SOURCES = ["reddit", "x"]
CACHE = Path("cache")

end = datetime.now(timezone.utc).date() - timedelta(days=1)  # last full UTC day
start = end - timedelta(days=13)


def stock(source, ticker):
    """One request per source and ticker, cached on disk per date window."""
    path = CACHE / f"{source}-{ticker}-{start}-{end}.json"
    if path.exists():
        return json.loads(path.read_text())
    r = requests.get(f"{API}/{source}/stocks/v1/stock/{ticker}", headers=HEADERS,
                     params={"from": str(start), "to": str(end)}, timeout=30)
    r.raise_for_status()  # 401 bad key, 403 window too long for the plan, 429 limit
    CACHE.mkdir(exist_ok=True)
    path.write_text(r.text)
    return r.json()


rows = []
for ticker in TICKERS:
    for source in SOURCES:
        for day in stock(source, ticker).get("daily_trend") or []:
            rows.append({"date": day["date"], "ticker": ticker, "source": source,
                         "buzz": day.get("buzz_score"), "sent": day.get("sentiment_score"),
                         "mentions": day["mentions"]})

df = pd.DataFrame(rows).pivot_table(index=["ticker", "date"], columns="source",
                                    values=["buzz", "sent", "mentions"])
df.columns = [f"{source}_{field}" for field, source in df.columns]
df = df.sort_index()

# Mentions against the ticker's own average of the 7 days before
for source in SOURCES:
    prior = df.groupby(level="ticker")[f"{source}_mentions"].transform(
        lambda s: s.shift(1).rolling(7).mean())
    df[f"{source}_vs_7d"] = (df[f"{source}_mentions"] / prior).round(2)

# A day's numbers are final only after that UTC day ends: use them from the next day on
df = df.reset_index()
df["usable_from"] = pd.to_datetime(df["date"]) + pd.Timedelta(days=1)

cols = ["ticker", "date", "reddit_buzz", "x_buzz", "reddit_sent", "x_sent", "reddit_vs_7d", "x_vs_7d"]
print(df[df["date"] == str(end)][cols].to_string(index=False))

We ran it on November 29, 2026 at 06:34 UTC. The window was November 15 to November 28:

Output
ticker       date  reddit_buzz  x_buzz  reddit_sent  x_sent  reddit_vs_7d  x_vs_7d
  AAPL 2026-11-28         78.1    85.0       -0.009   0.084          0.78     0.95
  NVDA 2026-11-28         83.9    89.9       -0.019   0.095          0.15     0.78
  TSLA 2026-11-28         74.4    88.0       -0.039   0.110          0.55     0.96

The _vs_7d columns divide a day's mentions by the ticker's average over the 7 days before. Every value is below 1 here. November 28 was the Saturday after Thanksgiving. NVDA had 889 Reddit mentions that day against an average of about 5,860 in the week before. A weekday spike would show up as a value well above 1.

That is also why a bot needs a rule for weekends. People keep posting when the market is closed. Fold Saturday and Sunday into Monday's row or compare each day with the same weekday. Otherwise every Monday looks like a surge.

How do you avoid look-ahead bias with sentiment data?

Give the bot a day's numbers only after that day is over. A backtest that reads a value its live version could not have seen yet looks better than any real run.

  • Windows are UTC days. In the Adanos API, from and to are inclusive UTC days. Without to the window ends today.
  • Today is partial. At 06:33 UTC on November 29, 2026 the TSLA Reddit row for that day held 18 mentions. The full day before had 88. The SDK README says the last trend_history value of a live window is the current partial UTC day.
  • The UTC day outlasts the US session. The NYSE core session ends at 4:00 p.m. Eastern, which is 21:00 UTC in winter and 20:00 UTC in summer. A UTC day's numbers include three to four hours of posts after the close. So the values of day D belong to the bar of the next trading day. The script marks this with usable_from.
  • Early closes and holidays. On November 27, 2026 the NYSE closed at 1:00 p.m. Eastern. Map sentiment days to your exchange calendar, not to a fixed weekday list.
  • Store what the bot saw. Log each response with the time you fetched it. A live bot then trades on the same values your backtest replays.

The trend field follows the same rule. It compares the last 3 days of the requested window with the 3 before, so set to to the bar date minus one day.

How do you combine sentiment with price?

Join the sentiment frame to your daily bars on ticker and usable_from. Then treat the sentiment columns like any other feature. Your price model proposes the trade. Sentiment can block it, shrink it or add a column to the model.

Keep the test honest:

  • Run the same strategy with and without the sentiment columns. Count costs and slippage in both.
  • Split by time, not at random. Fit on the earlier period and test on the later one.
  • Expect short history. On Adanos, X data starts on January 26, 2026, so an X backtest covers months, not years.
  • Paper trade before real money. A rule that looks strong in one quarter can fade in the next.

These steps do not show that sentiment improves returns. They test whether it helps your strategy.

How many API requests does a sentiment bot need?

Count one request per call, then multiply by tickers, sources and polls. The free tier covers building and testing. A live bot that polls during the day needs Hobby or Professional.

Monthly API requests for common sentiment bot setups (30 days, Reddit and X)
SetupRequests per runPer monthSmallest plan
Daily, 3 tickers, stock endpoint6180Free
Daily, 50 tickers, compare endpoint10300Hobby
Hourly, 20 tickers, compare endpoint42,880Hobby
Hourly, 20 tickers, stock endpoint4028,800Hobby
Every 10 minutes, 100 tickers, stock endpoint200864,000Professional

The plans as of November 29, 2026:

  • Free: $0, 250 requests a month, 100 a minute, 30 days of history, non-commercial.
  • Hobby: $29 a month, 250,000 requests a month, 1,000 a minute, 90 days of history, non-commercial.
  • Professional: $299 a month, 2,500,000 requests a month, 1,000 a minute, up to 365 days of history, commercial use allowed.

Free and Hobby are for non-commercial use. Whether your bot counts as commercial depends on the terms. If you are unsure, ask contact@adanos.com before you go live. Responses carry X-RateLimit-Remaining-Monthly and X-RateLimit-Remaining-Burst headers. Have the bot log them and slow down before it hits zero.

How should a bot cache sentiment data?

Fetch each closed day once and poll live data no faster than it changes.

  • Past days: key the cache by source, ticker and date window, as the script does. A new day means a new key, so the bot pays once per day.
  • Live data: the Reddit collector runs hourly. Polling Reddit every minute returns the same numbers 60 times and costs 60 requests.
  • Many tickers: use /compare with up to 10 tickers per request in place of one stock call each.
  • Errors: on 429, wait and retry with backoff. Never treat an error as a quiet stock with zero mentions.

Every call counts against the quota, including repeats of the same query.

Where Adanos fits and where it does not

We build Adanos and the example above uses it. These are its strengths and limits for a trading bot.

Strengths

  • Daily buzz, sentiment and bullish and bearish shares per ticker for Reddit and X, plus news and Polymarket
  • Explicit UTC day windows with from and to
  • Up to 10 tickers per compare request
  • Documented quotas, rate-limit headers and a commercial tier

Limits

  • No streaming or WebSocket and an hourly Reddit collector. It does not suit intraday or high-frequency strategies
  • Short history for backtests: Free reaches 30 days, Hobby 90. On Professional, Reddit stocks and Polymarket reach 365 days. X starts on January 26, 2026
  • Free and Hobby are non-commercial
  • No StockTwits, Discord, Telegram or options flow data
  • We make no claim that our sentiment predicts returns. If you need years of history to test that, a vendor with a longer archive fits better

FAQ

Can social media sentiment predict stock returns?

No claim holds for every stock and period. ESMA's 2024 study of EU equities found only a transitory effect of social media sentiment on excess returns. Price overreaction typically lasted no more than one day. Treat sentiment as context for a decision. Test any rule out of sample before real money depends on it.

How do I avoid look-ahead bias with daily sentiment data?

Use a day's numbers only after that UTC day has closed. The from and to parameters take inclusive UTC days. Today's row keeps changing until midnight UTC. The US close at 4:00 p.m. Eastern falls three to four hours before the UTC day ends. So the values of day D belong to the bar of the next trading day.

Is the free Adanos plan enough for a trading bot?

For building and testing, yes. For a live bot, no. Free has 250 requests a month and 30 days of history. A daily snapshot of 3 tickers on Reddit and X uses 180 requests a month. An hourly poll of 20 tickers on the stock endpoint uses 28,800. Hobby has 250,000 requests a month for non-commercial use. A commercial bot needs Professional.

Should I combine Reddit and X into one sentiment score?

Keep them as separate columns. The two crowds often disagree. On November 28, 2026 Reddit sentiment for NVDA, TSLA and AAPL was slightly negative while X was positive for all three. Each buzz score measures attention on its own source, so a sum mixes two scales.

How often should a bot poll sentiment data?

No faster than the data changes. The Reddit collector runs hourly, so polling Reddit every minute returns the same numbers and spends requests. Use the compare endpoint to fetch up to 10 tickers per request. Cache past days on disk so the bot fetches each one once.

Sources

We checked each vendor's pages in November 2026. Vendors change plans, so check the current terms before you commit. All code and API output on this page are from November 29, 2026.

  1. ESMA, Social media sentiment: influence on EU equity prices (TRV Risk Analysis, April 3, 2024)
  2. FINRA, Social sentiment investing tools: think twice before trading based on social media (April 2019)
  3. NYSE, holidays and trading hours, including the November 27, 2026 early close
  4. Adanos API overview for agents: period rules, compare limit and rate-limit headers
  5. Adanos Python SDK README, UTC day semantics of trend_history
  6. Adanos API reference
  7. Adanos pricing

Keep reading

  • Finnhub vs Alpha Vantage for news sentiment: which is better?Alpha Vantage scores each article and ticker. Finnhub rolls the news up into one score per US company. We compare fields, history, prices and license terms as of November 2026.Read the older article
  • How do I get Reddit sentiment for a stock in Python?Two tested routes. The Adanos SDK returns scored Reddit sentiment in one call. PRAW plus VADER needs Reddit credentials and a fix for finance slang.Read the newer article
  • Best Stock Sentiment APIs in 2026: Social, News and Market-Implied Signal ComparedWe sort eleven stock sentiment APIs by what they do. Enterprise news feeds, self-serve social APIs and free Reddit trackers solve different problems. The right pick depends on the signal you need and on whether you can sign up yourself or need a contract.Read the article