Your team or your trading Discord does not want another dashboard. It wants the number in the channel it already reads. A short message at 8:30 with yesterday's moves and this week's earnings. A ping when a stock you care about drops 3%.
You can build that in one Python file. It reads quotes and the earnings calendar from SteadyAPI, and posts to Slack or Discord through a webhook. There is no bot framework, no OAuth app and no server to host. A cron job runs it.
This is a one-way bot. It posts to a channel and does not listen for commands. That covers daily summaries and alerts, which is what most channels need.
Prerequisites
- A SteadyAPI account and API key from steadyapi.com. The Free plan ($0, no credit card) is enough to build and test it.
- Python 3.8+ with
requests. - A webhook URL for Slack, Discord, or both.
Step 1: Get a webhook URL
- Slack: create an app, turn on Incoming Webhooks, and add a webhook to your channel. It looks like
https://hooks.slack.com/services/.... - Discord: open the channel settings, go to Integrations, create a webhook, and copy its URL.
Both accept a JSON POST. Slack reads a text field. Discord reads a content field, capped at 2,000 characters.
Treat the URL like a password. Anyone who has it can post to your channel. Keep it in an environment variable, never in the code or in Git.
Step 2: The helpers
import json
import os
import sys
from datetime import date
import requests
API_KEY = os.environ["STEADYAPI_KEY"]
SLACK_URL = os.environ.get("SLACK_WEBHOOK_URL")
DISCORD_URL = os.environ.get("DISCORD_WEBHOOK_URL")
BASE = "https://api.steadyapi.com"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
WATCHLIST = ["AAPL", "MSFT", "NVDA", "TSLA", "AMD"]
def get(path, **params):
r = requests.get(f"{BASE}{path}", headers=HEADERS, params=params, timeout=30)
r.raise_for_status()
data = r.json()
if data.get("success") is False:
raise RuntimeError(data.get("message", "Request failed"))
return data
def post(text):
if SLACK_URL:
requests.post(SLACK_URL, json={"text": text}, timeout=15).raise_for_status()
if DISCORD_URL:
for i in range(0, len(text), 1900): # stay under Discord's 2,000-character limit
requests.post(DISCORD_URL, json={"content": text[i:i + 1900]},
timeout=15).raise_for_status()
Step 3: The daily summary
The quotes endpoint returns every watchlist symbol in one call, as numbers: regularMarketPrice and regularMarketChangePercent. Read the details in the quotes docs.
The earnings calendar returns reports for the next days days, 50 per page. The fields you need are symbol, nextEarningsDate, timeCode and estimatedEarnings. See the earnings calendar guide for how paging and the optionable filter work.
def upcoming_earnings():
rows, page = [], 1
while True:
data = get("/v2/markets/calendar/earnings", days=7, page=page)
batch = data.get("body") or []
rows += batch
if not batch or len(rows) >= int(data["meta"].get("total") or 0):
return rows
page += 1
def summary():
quotes = get("/v1/markets/stock/quotes", ticker=",".join(WATCHLIST))["body"]
lines = [f"Market summary for {date.today():%b %d}"]
for q in sorted(quotes, key=lambda q: q["regularMarketChangePercent"], reverse=True):
lines.append(f'{q["symbol"]:6} {q["regularMarketPrice"]:>9.2f} '
f'{q["regularMarketChangePercent"]:+.2f}%')
reports = [e for e in upcoming_earnings() if e["symbol"] in WATCHLIST]
if reports:
lines.append("")
lines.append("Earnings this week:")
for e in reports:
lines.append(f'{e["symbol"]:6} {e["nextEarningsDate"]} {e["timeCode"]}, '
f'est. EPS {e["estimatedEarnings"]}')
post("```\n" + "\n".join(lines) + "\n```") # a code block keeps the columns aligned
The earnings section is skipped when none of your symbols report. A quiet week gives a short message. Both Slack and Discord render the triple-backtick block in a fixed-width font.
Step 4: Threshold alerts that fire once
A poller that re-sends the same alert every five minutes is worse than no alert. Keep a small state file, and record each symbol you have already flagged today.
THRESHOLD = 3.0 # percent move that triggers an alert
STATE_FILE = "alert_state.json"
def alerts():
today = date.today().isoformat()
try:
state = json.load(open(STATE_FILE))
except FileNotFoundError:
state = {}
sent = set(state.get(today, []))
quotes = get("/v1/markets/stock/quotes", ticker=",".join(WATCHLIST))["body"]
fresh = [q for q in quotes
if abs(q["regularMarketChangePercent"]) >= THRESHOLD and q["symbol"] not in sent]
for q in fresh:
post(f'{q["symbol"]} is {q["regularMarketChangePercent"]:+.2f}% today, '
f'now {q["regularMarketPrice"]:.2f}')
sent.add(q["symbol"])
json.dump({today: sorted(sent)}, open(STATE_FILE, "w"))
if __name__ == "__main__":
{"summary": summary, "alerts": alerts}[sys.argv[1]]()
Step 5: Schedule it
Put the three environment variables at the top of your crontab, then add the two jobs:
STEADYAPI_KEY=YOUR_STEADYAPI_KEY
SLACK_WEBHOOK_URL=YOUR_SLACK_WEBHOOK_URL
DISCORD_WEBHOOK_URL=YOUR_DISCORD_WEBHOOK_URL
30 8 * * 1-5 /usr/bin/python3 /path/to/bot.py summary
30-55/5 9 * * 1-5 /usr/bin/python3 /path/to/bot.py alerts
*/5 10-15 * * 1-5 /usr/bin/python3 /path/to/bot.py alerts
The times use your server's clock. Set the server to New York time, or shift the hours. The alert job starts at 9:30 so it never reports the previous session's move as news.
What it costs
A quotes call has a weight of 2, and each earnings page has a weight of 2. One summary is a handful of requests: 2 for quotes, plus 2 for each earnings page. The alert job polls every 5 minutes, which is 78 calls in a 6.5-hour session. That is about 156 requests a day, or roughly 3,300 a month over 21 trading days.
- Free plan: 500 requests a month, capped at 20 a day. Run the summary only, or run alerts a few times a day.
- Starter (10,000 requests): the schedule above fits.
Only HTTP 200 responses count toward your quota.
Best practices
- Alert once. Keep the state file, as above. Reset it daily.
- Send one message per run. Build the whole text, then post it once. Do not post a message per symbol.
- Check the webhook response.
raise_for_status()makes a bad URL or a rate limit fail loudly in the cron mail instead of silently. - Check the API body too. A bad ticker list can return HTTP 200 with
successset tofalse. Theget()helper raises on it. - Keep secrets out of Git. That means your API key and both webhook URLs.
- Respect the rate limit. The standard limit is 10 requests per second per account. This bot uses a tiny fraction.
Bonus: ask it in plain English
You can connect Claude Code, Cursor, VS Code, or any MCP client to https://api.steadyapi.com/mcp with your API key. Then ask for a market summary of your watchlist in chat, before you automate it.
Conclusion
You built a Slack and Discord bot in one file. It sends a daily summary with prices and upcoming earnings, and it sends threshold alerts once per symbol. Cron runs it, and a webhook delivers it.
Create a free account at steadyapi.com (no card required) and copy your API key. Then browse the API documentation for every parameter and ready-made examples in cURL, JavaScript, PHP, and Python.