PYTHON · VISUALIZATION

Meridian Edge + Plotly

Build interactive prediction market consensus charts with Plotly — probability bars, divergence scatter plots, and live-updating dashboards.

Connect Plotly to Meridian Edge to visualize real-time prediction market consensus from 25+ regulated sources. Create publication-quality interactive charts with just a few lines of Python.

Requirements

Installpip install plotly requests pandas

Integration Code

Plotly Consensus Chartpython
import plotly.express as px
import plotly.graph_objects as go
import requests
import pandas as pd

API_KEY = "me_live_YOUR_KEY"

def get_consensus_df(sport="NBA"):
    r = requests.get(
        "https://meridianedge.io/api/v1/consensus",
        headers={"X-API-Key": API_KEY},
        params={"sport": sport, "limit": 15}
    )
    df = pd.DataFrame(r.json().get("events", []))
    df["consensus_pct"] = (df["consensus_prob"] * 100).round(1)
    df["title_short"] = df["title"].str[:45]
    return df

df = get_consensus_df("NBA")

# Horizontal probability bar chart
fig = px.bar(df.sort_values("consensus_pct"),
             x="consensus_pct", y="title_short",
             orientation="h",
             color="consensus_pct",
             color_continuous_scale=["#ef4444","#f59e0b","#22c55e"],
             range_color=[0, 100],
             title=f"NBA Prediction Market Consensus",
             labels={"consensus_pct":"Consensus %","title_short":"Event"})
fig.update_layout(showlegend=False, height=500, template="plotly_dark")
fig.show()

# Divergence scatter
fig2 = px.scatter(df, x="consensus_pct", y="divergence_pct",
                  hover_name="title", size_max=20,
                  title="Consensus vs. Divergence")
fig2.show()

Try it — API key in 10 seconds

Get your API key and build interactive prediction market charts with Plotly in minutes.

View Plans → API Reference

Frequently Asked Questions

How do I make prediction market charts with Plotly?
Fetch consensus data from the Meridian Edge API into a pandas DataFrame, then pass it to plotly.express.bar() or scatter(). The consensus_prob and divergence_pct fields map directly to chart axes.
What does Plotly + Meridian Edge cost?
Yes. Plotly is open source. Meridian Edge starter tier: 100 calls/day. Get a key at meridianedge.io/#pricing.