npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

meridian-edge

v0.1.1

Published

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

Readme

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.