Simple Flask API to:
- fetch active IPOs from NSE
- scrape GMP from Chittorgarh and IPOWatch
- fetch gold price from Safegold
- compute GMP percent
- return cleaned JSON
- send formatted updates to Discord
- send formatted updates to Telegram
-
GET /track- Returns current IPO tracking payload.
-
POST /track/notify-discord- Builds payload and sends to Discord webhook.
- Protected by local-IP/token checks.
-
POST /track/notify-telegram- Builds payload and sends to Telegram bot chat.
- Protected by local-IP/token checks.
{
"date": "26 Feb 2026",
"gold_price": {
"source": "safegold",
"buy_price_per_gram": 7125.5,
"sell_price_per_gram": 7050.25,
"currency": "INR",
"as_of": "2026-02-26T09:20:00+00:00"
},
"ipos": [
{
"ipo_name": "PNGS Reva Diamond Jewellery Limited",
"subscription_window": "24 Feb 2026 – 26 Feb 2026",
"gmp_percent": 3.9,
"subscription_multiple": 1.25,
"action": "AVOID",
"reason": "Low GMP around 4% and moderate subscription."
}
]
}- Install dependencies:
pip install -r requirements.txt- Create env file:
cp .env.example .env-
Fill
.envvalues. -
Run server:
python3 app.pyDefault app port is 8001.
DISCORD_WEBHOOK_URL: Discord incoming webhook URLTELEGRAM_BOT_TOKEN: Telegram bot token from BotFatherTELEGRAM_CHAT_ID: destination chat ID (user/group/channel)TELEGRAM_PARSE_MODE: optional parse mode (Markdown,HTML, or empty)TELEGRAM_DISABLE_WEB_PREVIEW:true/false(defaulttrue)SAFEGOLD_BUY_URL: Safegold API endpoint for gold buy priceSAFEGOLD_SELL_URL: Safegold API endpoint for gold sell priceTRACK_NOTIFY_TOKEN: secret token for manual/external triggeringTRACK_NOTIFY_ALLOW_IPS: comma-separated allowed IPs (non-loopback)TRUST_PROXY_HEADERS:true/false(defaultfalse)TRUSTED_PROXY_IPS: comma-separated proxy IPs (used only when trust is enabled)
- Always allows loopback (
127.0.0.1,::1) for local cron. - Allows IPs listed in
TRACK_NOTIFY_ALLOW_IPS. - Allows requests with:
X-Track-Token: <TRACK_NOTIFY_TOKEN>, orAuthorization: Bearer <TRACK_NOTIFY_TOKEN>
50 9 * * * curl -fsS -X POST http://127.0.0.1:8001/track/notify-discord >> /var/log/ipo_track_cron.log 2>&1
0 15 * * * curl -fsS -X POST http://127.0.0.1:8001/track/notify-discord >> /var/log/ipo_track_cron.log 2>&1
# Telegram (optional, separate trigger)
50 9 * * * curl -fsS -X POST http://127.0.0.1:8001/track/notify-telegram >> /var/log/ipo_track_cron.log 2>&1
0 15 * * * curl -fsS -X POST http://127.0.0.1:8001/track/notify-telegram >> /var/log/ipo_track_cron.log 2>&1- Keep
.envprivate (already git-ignored). - If any secret was exposed, rotate it immediately.
- Just Join Discord Channel: https://discord.gg/EayyBFjzdw
- Just Join Telegram Channel: https://t.me/ipoTrackUpdates