Official Node.js client for the Meridian Edge prediction market analytics API. Zero dependencies, native fetch (Node.js 18+).
npm install meridian-edgeconst MeridianEdge = require('meridian-edge');
const client = new MeridianEdge({
apiKey: 'me_your_api_key',
});
// List NBA markets
const markets = await client.markets({ sport: 'NBA', limit: 10 });
console.log(markets.data);
// Get cross-platform consensus probabilities
const consensus = await client.consensus({ sport: 'NBA', minSpread: 0.02 });
console.log(consensus.data);new MeridianEdge({ apiKey, baseUrl, timeout })| Parameter | Type | Default | Description |
|---|---|---|---|
apiKey |
string |
required | Your API key (starts with me_) |
baseUrl |
string |
https://api.meridianedge.io/api/v1 |
API base URL |
timeout |
number |
30000 |
Request timeout in milliseconds |
Get platform status. No authentication required.
const status = await client.status();
// { status: 'ok', version: '...', ts: '...' }List active prediction markets with derived analytics.
| Option | Type | Default | Description |
|---|---|---|---|
sport |
string |
— | Filter by sport/league (e.g. "NBA", "MLS") |
limit |
number |
50 |
Results per page (max 200) |
offset |
number |
0 |
Pagination offset |
const markets = await client.markets({ sport: 'NBA', limit: 20 });Get details for a single market by event ID.
const detail = await client.market('EVT-NBA-BOS-NYK-20260401');List high-opportunity markets ranked by composite analytics score.
| Option | Type | Default | Description |
|---|---|---|---|
minScore |
number |
5 |
Minimum analytics score (1--10) |
limit |
number |
20 |
Number of results |
const opps = await client.opportunities({ minScore: 7, limit: 10 });Get recent analytics indicators.
| Option | Type | Default | Description |
|---|---|---|---|
limit |
number |
10 |
Number of results |
sport |
string |
— | Filter by sport/league |
const indicators = await client.indicators({ sport: 'NBA', limit: 5 });Get market data for a specific sport.
| Parameter | Type | Default | Description |
|---|---|---|---|
sport |
string |
required | Sport identifier (e.g. "NBA") |
date |
string |
— | Date filter (YYYY-MM-DD) |
const nba = await client.sports('NBA');
const historical = await client.sports('NBA', { date: '2026-03-28' });Alias for sports() -- returns today's data for a sport.
const today = await client.sportsToday('NBA');Get recently settled markets with outcomes.
| Option | Type | Default | Description |
|---|---|---|---|
limit |
number |
20 |
Number of results |
sport |
string |
— | Filter by sport |
const settled = await client.settlementsRecent({ limit: 10, sport: 'NBA' });Verify the settlement outcome for a specific event.
const verification = await client.verifySettlement('EVT-NBA-BOS-NYK-20260401');
// { outcome: 'yes', source: '...', verified_at: '...' }Get settlements filtered by sport.
| Parameter | Type | Default | Description |
|---|---|---|---|
sport |
string |
required | Sport identifier |
date |
string |
— | Date filter (YYYY-MM-DD) |
const nbaSettlements = await client.settlementsBySport('NBA', { date: '2026-03-28' });Get current weather market analytics summary.
const weather = await client.weatherSummary();Get aggregated platform performance analytics.
| Option | Type | Default | Description |
|---|---|---|---|
days |
number |
30 |
Lookback window in days |
const perf = await client.performance({ days: 7 });List cross-platform consensus probabilities. Returns volume-weighted consensus probability for each active event, aggregated from all available platforms.
| Option | Type | Default | Description |
|---|---|---|---|
sport |
string |
— | Filter by sport/league |
minPlatforms |
number |
2 |
Minimum platforms required |
minSpread |
number |
— | Minimum cross-platform spread (e.g. 0.03 for 3%+) |
limit |
number |
20 |
Maximum results |
const consensus = await client.consensus({
sport: 'NBA',
minSpread: 0.02,
limit: 10,
});
for (const item of consensus.data) {
console.log(item.event_key, item.consensus_prob);
}Get detailed consensus data for a single event.
const detail = await client.consensusDetail('NBA-BOS-NYK-20260401');Create a Stripe checkout session for a subscription plan.
| Option | Type | Default | Description |
|---|---|---|---|
plan |
string |
required | "starter", "pro", or "allaccess" |
email |
string |
required | User email address |
interval |
string |
"monthly" |
"monthly" or "annual" |
const checkout = await client.subscribe({
plan: 'starter',
email: '[email protected]',
});
console.log(checkout.checkout_url);const { MeridianEdge, MeridianError } = require('meridian-edge');
try {
const data = await client.markets();
} catch (err) {
if (err instanceof MeridianError) {
console.error(`API error ${err.statusCode}: ${err.message}`);
console.error('Detail:', err.detail);
}
}The SDK automatically retries on network errors and 429 Too Many Requests responses (up to 3 attempts with exponential backoff). The Retry-After header is respected when present.
The SDK works well as a data source for AI agents. See examples/agent-example.js for a LangChain-style tool integration pattern.
- API Documentation -- Full REST API reference
- Python SDK -- Python client library
- MCP Server -- Model Context Protocol server for AI assistants
MIT -- see LICENSE.
For informational purposes only. Not investment advice. Prediction market data is provided as-is with no guarantee of accuracy or completeness. Past performance does not indicate future results.