PYTHON · AI AGENT

Meridian Edge + LangChain

Add real-time prediction market consensus as a LangChain tool — your agents can query NBA, NHL, MLB, and political probabilities on demand.

Connect LangChain to Meridian Edge to access real-time prediction market consensus from 25+ regulated sources. Your agents get calibrated probabilities for thousands of events, updated continuously throughout the day.

Requirements

Installpip install langchain requests

Integration Code

LangChain Agent Toolpython
from langchain.tools import Tool
import requests

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

def get_consensus(query: str) -> str:
    """Get prediction market consensus for a sport or event."""
    sport = "NBA"  # parse from query in production
    r = requests.get(
        "https://meridianedge.io/api/v1/consensus",
        headers=HEADERS,
        params={"sport": sport, "limit": 5}
    )
    events = r.json().get("events", [])
    return "\n".join(
        f"{e['title']}: {e['consensus_prob']:.0%}"
        for e in events[:5]
    )

consensus_tool = Tool(
    name="PredictionMarketConsensus",
    func=get_consensus,
    description="Get real-time prediction market consensus probabilities for sports events."
)

# Add to your agent
from langchain.agents import initialize_agent
# agent = initialize_agent([consensus_tool], llm, ...)

Try it — API key in 10 seconds

Instant activation. Get your API key and start querying live NBA, NHL, MLB, and political consensus from your LangChain agent.

View Plans → API Reference

Frequently Asked Questions

How do I use LangChain with prediction market data?
Wrap the Meridian Edge /api/v1/consensus endpoint as a LangChain Tool. Pass your API key via the X-API-Key header. The tool function can accept a sport or event name and return structured consensus probabilities.
Can I use the Meridian Edge API with LangChain projects?
Yes. The starter tier gives you 100 API calls per day with instant activation. Get a key at meridianedge.io/#pricing.