PYTHON ยท WEB

Meridian Edge + Flask

Use Flask to build a lightweight prediction market data proxy or alert service backed by Meridian Edge consensus data.

Connect Flask to Meridian Edge to access real-time prediction market consensus from 25+ regulated sources. A simple proxy pattern lets you add authentication, caching, or custom business logic on top of the API.

Requirements

Installpip install flask requests

Integration Code

Flask Proxy Apppython
from flask import Flask, jsonify, request
import requests

app     = Flask(__name__)
API_KEY = "me_live_YOUR_KEY"
HEADERS = {"X-API-Key": API_KEY}
BASE    = "https://meridianedge.io/api/v1"

@app.route("/api/consensus")
def consensus():
    sport = request.args.get("sport", "NBA")
    limit = request.args.get("limit", 10)
    r = requests.get(f"{BASE}/consensus",
                     headers=HEADERS,
                     params={"sport": sport, "limit": limit})
    return jsonify(r.json())

@app.route("/api/divergence")
def divergence():
    sport = request.args.get("sport", "NBA")
    r = requests.get(f"{BASE}/consensus",
                     headers=HEADERS,
                     params={"sport": sport, "limit": 50})
    events = r.json().get("events", [])
    high_div = [e for e in events if e.get("divergence_pct", 0) > 0.04]
    return jsonify({"events": high_div, "count": len(high_div)})

if __name__ == "__main__":
    app.run(debug=True)

Try it โ€” API key in 10 seconds

Get your API key and run this Flask app locally or deploy to Heroku, Render, or any WSGI host.

View Plans → API Reference

Frequently Asked Questions

How do I call the Meridian Edge API from Flask?
Use the requests library inside your Flask route handlers. Set the X-API-Key header with your API key and call the /api/v1/consensus endpoint. For production, use Flask-Caching to avoid redundant API calls.
What does Flask + Meridian Edge cost?
Yes. Meridian Edge starter tier: 100 calls/day. Flask is open source. Get a key at meridianedge.io/#pricing.