Build a Telegram bot that sends real-time prediction market consensus alerts โ divergence signals, pre-game consensus, and daily summaries.
Connect your Telegram bot to Meridian Edge to access real-time prediction market consensus from 25+ regulated sources. Get alerts on divergence, high-confidence events, and consensus shifts delivered directly to Telegram.
pip install python-telegram-bot requestsimport asyncio
import requests
from telegram import Bot
BOT_TOKEN = "YOUR_TELEGRAM_BOT_TOKEN"
CHAT_ID = "YOUR_CHAT_ID"
API_KEY = "me_live_YOUR_KEY"
HEADERS = {"X-API-Key": API_KEY}
async def send_consensus_alert(sport="NBA"):
r = requests.get(
"https://meridianedge.io/api/v1/consensus",
headers=HEADERS,
params={"sport": sport, "limit": 10}
)
events = r.json().get("events", [])
# Only alert on high-divergence events
alerts = [e for e in events if e.get("divergence_pct", 0) > 0.04]
if not alerts:
return
bot = Bot(token=BOT_TOKEN)
lines = [f"๐ Divergence Alert โ {sport}\n"]
for e in alerts[:5]:
prob = round(e['consensus_prob'] * 100)
div = round(e.get('divergence_pct', 0) * 100, 1)
lines.append(f"โข {e['title']}\n {prob}% consensus | {div}% divergence")
lines.append("\nNot investment advice")
await bot.send_message(chat_id=CHAT_ID, text="\n".join(lines), parse_mode="HTML")
asyncio.run(send_consensus_alert("NBA"))Get your Meridian Edge API key, create a Telegram bot with @BotFather, and start receiving prediction market alerts.
View Plans → API Reference