Prediction Market API for Python

Query real-time prediction market consensus data in Python. Install with pip, call in three lines.

See Plans →

Summary: Python SDK for prediction market consensus data. pip install meridianedge. Query probabilities, divergence, and settlements in three lines of code.

Installation

pip install meridianedge

The SDK requires Python 3.8+. No external dependencies beyond requests.

Quick Start

from meridianedge import MeridianEdge

client = MeridianEdge(api_key="your-api-key")

# Get consensus probabilities for NBA events
nba = client.consensus(vertical="sports", sport="NBA")

for event in nba["data"]:
    print(f'{event["question"]}: {event["probability"]:.0%}')

Available Methods

MethodReturns
client.consensus()Aggregated probabilities for active events
client.opportunities()High-divergence events across platforms
client.markets()All active markets with metadata
client.settlements_recent()Recently resolved events with outcomes
client.sports("NBA")Today's data for a specific sport
client.status()API health check (no auth required)

Agent Framework Integration

The SDK works as a data source in any Python agent framework. Use it as a LangChain tool, a CrewAI data source, or a LlamaIndex query engine. For Claude and Cursor integration, see the MCP server guide.

Error Handling

The SDK raises MeridianError for API errors with status code, message, and detail fields. Automatic retries handle transient network errors and rate limit responses (429).

Related

Frequently Asked Questions

How do I install the prediction market Python SDK?

Run pip install meridianedge. The SDK requires Python 3.8+ and handles authentication, retries, and rate limiting automatically.

Can I use prediction market data in LangChain?

Yes. The meridianedge Python SDK can be used as a tool or data source in LangChain, CrewAI, LlamaIndex, and any Python agent framework. For Claude-native integration, use the MCP server.

Is the Python SDK data investment advice?

No. All data accessed through the SDK is for informational purposes only and does not constitute investment, financial, or trading advice. Prediction market participation involves risk of loss.

Get Full Access

Starter plan includes API access, the live dashboard, divergence alerts, and email digests.

See Plans →