How to Build a Prediction Market Bot

A prediction market bot queries the consensus API on a schedule, identifies signals worth acting on, and sends alerts or triggers logic. Here's the full pattern.

Architecture overview

A basic prediction market bot has four components:

Step 1: Get an API key

Visit meridianedge.iothe pricing page. Enter your email and your key appears instantly. The starter tier gives you 100 calls/day — enough to poll all sports every 15 minutes.

Step 2: Write the poller

import requests, time, json

API_KEY = "me_live_your_key_here"
HEADERS = {"X-API-Key": API_KEY}
BASE    = "https://meridianedge.io/api/v1"

def fetch_consensus(sport="NBA", limit=20):
    r = requests.get(f"{BASE}/consensus",
                     headers=HEADERS,
                     params={"sport": sport, "limit": limit})
    r.raise_for_status()
    return r.json().get("events", [])

Step 3: Detect divergence signals

def find_divergence(events, threshold=0.04):
    """Return events where markets disagree by more than threshold."""
    return [
        e for e in events
        if e.get("divergence_pct", 0) >= threshold
    ]

Step 4: Alert on signals

import smtplib
from email.mime.text import MIMEText

def alert(event):
    title = event["title"]
    prob  = event["consensus_prob"]
    div   = event["divergence_pct"]
    print(f"SIGNAL: {title} | prob={prob:.0%} | div={div:.1%}")
    # Add Slack/email/webhook call here

Step 5: Schedule and run

import schedule

def job():
    events = fetch_consensus("NBA")
    signals = find_divergence(events)
    for e in signals:
        alert(e)

schedule.every(5).minutes.do(job)
while True:
    schedule.run_pending()
    time.sleep(30)

Frequently asked questions

What do I need to build a prediction market bot?
You need an API key (meridianedge.io/#pricing), Python or your preferred language, and a clear strategy for what the bot should do — monitor for divergence, alert on probability changes, or track specific events.
Can I automate prediction market monitoring with an API?
Meridian Edge provides data and consensus signals, not execution. You would connect the data feed to your own decision logic and a brokerage or market platform that offers an execution API.
Is Python the best language for a prediction market bot?
Python is the most common choice due to libraries like requests, pandas, and schedule. Any language with HTTP support works fine — the Meridian Edge API returns standard JSON.

Get API Access

Plans start at $29/mo. 1,000 calls/day. Key in 10 seconds.

View Plans →

Need more? Starter ($29/mo) — 1,000 calls/day + divergence signals