AI-powered WhatsApp chatbot that tells you why your stocks moved — not just that they did.
Most stock apps tell you a stock is down 2%. This tells you why. You → WhatsApp "NVDA" Bot → ↓ NVDA -1.89% — geopolitical risk in China, data center revenue miss, and fears the AI rally is overheating.
Built with a real agentic loop — the AI autonomously fetches live prices, pulls recent news, and synthesizes everything into one clean insight delivered straight to your WhatsApp.
| You send | You receive |
|---|---|
NVDA |
↑ NVDA +2.58% — expanded AI collaboration with Cadence driving optimism |
AAPL |
↑ AAPL +0.00% — steady demand for iPhones and services, no major catalysts |
TSLA |
↑ TSLA +0.97% — strong FSD v15 rollout and Ark Investment accumulation |
User (WhatsApp)
│
▼
Twilio
│ webhook
▼
FastAPI
│
├──────────────────────────┐
▼ ▼
AI Agent (Groq LLM) Scheduler (9AM)
│ │
├──► Finnhub (price) │
├──► NewsAPI (news) │
│ │
▼ ▼
Insight ◄─────────────────────┘
│
▼
User (WhatsApp)
| Layer | Technology |
|---|---|
| Language | Python 3.13 |
| Backend | FastAPI |
| AI / LLM | Groq (Llama 3.3 70B) |
| Stock Data | Finnhub API |
| News | NewsAPI |
| Messaging | Twilio WhatsApp |
| Scheduler | APScheduler |
| Tunnel | ngrok |
git clone https://github.com/jayraval30/stock-tracker-agent.git
cd stock-tracker-agentpip install -r requirements.txtcp .env.example .envuvicorn app.main:app --reload --port 8000ngrok http 8000Go to Twilio Console → Messaging → Try it out → WhatsApp → paste your ngrok URL: https://your-ngrok-url.ngrok-free.dev/webhook/sms
stock_tracker_agent/
├── app/
│ ├── agent.py # Agentic loop with tool calling
│ ├── tools.py # Finnhub + NewsAPI integration
│ ├── main.py # FastAPI server + webhook handler
│ ├── sms.py # Twilio WhatsApp helper
│ ├── scheduler.py # Daily 9AM digest
│ └── config.py # Pydantic settings
├── tests/
│ └── test_agent.py
├── .env.example
├── requirements.txt
└── README.md
| Variable | Description |
|---|---|
GROQ_API_KEY |
Groq API key — free at console.groq.com |
TWILIO_ACCOUNT_SID |
Twilio Account SID |
TWILIO_AUTH_TOKEN |
Twilio Auth Token |
TWILIO_PHONE_NUMBER |
Your Twilio number |
FINNHUB_API_KEY |
Finnhub API key — free at finnhub.io |
NEWS_API_KEY |
NewsAPI key — free at newsapi.org |
USER_PHONE_NUMBER |
Your WhatsApp number |
WATCHLIST |
Stocks for daily digest |
- User sends a stock ticker via WhatsApp
- FastAPI webhook receives the message
- Agent calls
get_stock_quote()→ fetches live price and % change from Finnhub - Agent calls
get_stock_news()→ fetches latest headlines from NewsAPI - Groq LLM synthesizes price data and news into one clean insight
- Twilio sends the insight back to the user's WhatsApp
The agent uses a tool-calling loop — it autonomously decides which tools to call, executes them, and only responds when it has enough context to generate a meaningful insight.
Every morning at 9AM EST, the scheduler automatically sends insights for all stocks in your watchlist — no message needed.
MIT License — feel free to use, modify and distribute.