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 picks

bot.ts
const { data: picks } = await mrdoge.ai.picks.list({
  date: new Date().toISOString().slice(0, 10),
  limit: 10,
});

for (const pick of picks) {
  console.log(`Pick ${pick.id} · ${pick.pickType} · ${pick.totalOdds.toFixed(2)}`);
  for (const leg of pick.legs) {
    console.log(
      `  → ${leg.outcome} @ ${leg.odds}`,
      `(${leg.confidence}${leg.edgePercentage ? `, edge: ${(leg.edgePercentage * 100).toFixed(1)}%` : ""})`,
    );
    for (const reason of leg.rationale) {
      console.log(`    · ${reason}`);
    }
  }
}

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

What's next

On this page

Quickstart