Mr. Doge

Quickstart

From zero to streaming live matches in five minutes.

This guide assumes you have an API key. Don't have one yet? Mint one in the dashboard.

Install the SDK

npm i @mrdoge/node

Create a client

bot.ts
import { MrDoge } from "@mrdoge/node";

const mrdoge = new MrDoge({
  apiKey: process.env.MRDOGE_API_KEY!,
});

Make your first call

bot.ts
const { data: matches } = await mrdoge.matches.list({
  sports: ["soccer"],
  status: ["live"],
  limit: 5,
});

for (const match of matches) {
  console.log(
    `${match.homeTeam.name} vs ${match.awayTeam.name}`,
    match.stats
      ? `${match.stats.homeScore}-${match.stats.awayScore}`
      : "(upcoming)",
  );
}

Run it:

MRDOGE_API_KEY=sk_live_… node bot.ts

You should see live matches print to stdout.

Subscribe to live updates

The real magic — live deltas as scores and odds change.

bot.ts
const sub = await mrdoge.matches.subscribeLive({ sports: ["soccer"] });

// initial state — already populated from the HTTP cold-start cache
console.log("Snapshot:", sub.snapshot.length, "matches");

// stream deltas as the server pushes them
sub.on("match.upd", (match) => {
  console.log(
    `[${match.id}]`,
    match.homeTeam.name,
    match.stats?.homeScore,
    "-",
    match.stats?.awayScore,
    match.awayTeam.name,
  );
});

sub.on("match.del", (matchId) => {
  console.log("[del]", matchId);
});

// later, when you're done:
await sub.cancel();

Under the hood the SDK races HTTP cache (~100ms) against the WebSocket handshake (~1.5s) — whichever resolves first populates sub.snapshot. WS continues for the live deltas. See transports for the deep dive.

Pull AI recommendations

bot.ts
const { data: recs } = await mrdoge.ai.recommendations.list({
  minEdge: 0.05,
  confidence: "High",
  limit: 10,
});

for (const r of recs) {
  console.log(
    `${r.outcome} @ ${r.odds}`,
    `(${r.confidence}, edge: ${(r.edgePercentage * 100).toFixed(1)}%)`,
  );
  for (const reason of r.rationale) {
    console.log(`  · ${reason}`);
  }
  for (const risk of r.riskFactors) {
    console.log(`  risk: ${risk}`);
  }
}

AI recommendations are gated to the Business tier. Upgrade your plan if you get a forbidden error.

What's next

On this page