Skip to content

tmbot12/meridian-edge-sdk-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meridian Edge Node.js SDK

Official Node.js client for the Meridian Edge prediction market analytics API. Zero dependencies, native fetch (Node.js 18+).

npm License: MIT

Installation

npm install meridian-edge

Quick Start

const 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);

Constructor

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

Methods

status()

Get platform status. No authentication required.

const status = await client.status();
// { status: 'ok', version: '...', ts: '...' }

markets(options?)

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 });

market(eventId)

Get details for a single market by event ID.

const detail = await client.market('EVT-NBA-BOS-NYK-20260401');

opportunities(options?)

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 });

indicators(options?)

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 });

sports(sport, options?)

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' });

sportsToday(sport)

Alias for sports() -- returns today's data for a sport.

const today = await client.sportsToday('NBA');

settlementsRecent(options?)

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' });

verifySettlement(eventId)

Verify the settlement outcome for a specific event.

const verification = await client.verifySettlement('EVT-NBA-BOS-NYK-20260401');
// { outcome: 'yes', source: '...', verified_at: '...' }

settlementsBySport(sport, options?)

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' });

weatherSummary()

Get current weather market analytics summary.

const weather = await client.weatherSummary();

performance(options?)

Get aggregated platform performance analytics.

Option Type Default Description
days number 30 Lookback window in days
const perf = await client.performance({ days: 7 });

consensus(options?)

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);
}

consensusDetail(eventKey)

Get detailed consensus data for a single event.

const detail = await client.consensusDetail('NBA-BOS-NYK-20260401');

subscribe(options)

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);

Error Handling

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.

AI Agent Integration

The SDK works well as a data source for AI agents. See examples/agent-example.js for a LangChain-style tool integration pattern.

Related Resources

View Plans

License

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.

About

Node.js SDK for the Meridian Edge prediction market consensus API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors