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.
pip install langchain requestsfrom 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, ...)Instant activation. Get your API key and start querying live NBA, NHL, MLB, and political consensus from your LangChain agent.
View Plans → API Reference