PYTHON · DATA ANALYSIS

Meridian Edge + Pandas

Load live prediction market consensus directly into pandas DataFrames — filter, sort, group, and analyze with the full pandas toolkit.

Connect pandas to Meridian Edge to access real-time prediction market consensus from 25+ regulated sources. A single requests call gets you a DataFrame ready for analysis.

Requirements

Installpip install requests pandas

Integration Code

Pandas DataFrame Loaderpython
import requests
import pandas as pd

API_KEY = "me_live_YOUR_KEY"
HEADERS = {"X-API-Key": API_KEY}

def load_consensus(sport="NBA", limit=50) -> pd.DataFrame:
    """Load prediction market consensus into a DataFrame."""
    r = requests.get(
        "https://meridianedge.io/api/v1/consensus",
        headers=HEADERS,
        params={"sport": sport, "limit": limit}
    )
    r.raise_for_status()
    df = pd.DataFrame(r.json().get("events", []))
    if df.empty:
        return df
    df["consensus_pct"] = (df["consensus_prob"] * 100).round(1)
    df["divergence_pct_num"] = (df.get("divergence_pct", 0) * 100).round(1)
    df["resolution"] = pd.to_datetime(df.get("resolution"))
    return df.sort_values("divergence_pct_num", ascending=False)

df = load_consensus("NBA")
print(df[["title","consensus_pct","divergence_pct_num","market_count"]].head(10))

# High-confidence events
high_conf = df[df["confidence"] > 0.85]
print(f"\n{len(high_conf)} high-confidence events")

# Aggregate by sport
for sport in ["NBA","NHL","MLB","MLS"]:
    df_s = load_consensus(sport, limit=20)
    if not df_s.empty:
        print(f"{sport}: avg consensus = {df_s['consensus_pct'].mean():.1f}%")

Try it — API key in 10 seconds

Get your API key and start loading live prediction market data into pandas in one function call.

View Plans → API Reference

Frequently Asked Questions

How do I load prediction market data into a pandas DataFrame?
Call the Meridian Edge /api/v1/consensus endpoint with requests and pass the events array directly to pd.DataFrame(). The response includes fields like consensus_prob, divergence_pct, and market_count that work directly as DataFrame columns.
What does pandas + Meridian Edge cost?
Yes. pandas is open source. Meridian Edge starter tier: 100 calls/day. Get a key at meridianedge.io/#pricing.