Guías / Kalshi sports odds API in Python and JavaScript

Kalshi sports odds API in Python and JavaScript

Por el equipo de dino.markets · Actualizado el 29 nov 2026

This guide gets Kalshi’s NBA game prices from the dino.markets API in Python and in JavaScript. You need one dino.markets key and no Kalshi account. Both scripts print each team’s American odds and the Kalshi price in cents.

curl "https://api.dino.markets/v2/odds?league=nba&books=kalshi&markets=moneyline&start_after=2026-11-29T12:00:00Z" -H "Authorization: Bearer $DINO_API_KEY"

The Heat at the Cavaliers, read 29 Nov 2026 at 02:41 UTC:

200 OK
{
  "key": "kalshi",
  "name": "Kalshi",
  "markets": [{ "key": "moneyline", "period": "game", "main": true, "updated_at": "2026-11-29T02:37:45Z", "outcomes": [
    { "name": "Cleveland Cavaliers", "side": "home", "price": "1.887", "american": "-113" },
    { "name": "Miami Heat", "side": "away", "price": "2.041", "american": "+104" }
  ] }]
}

Set your key

Create a key in the dashboard and export it as DINO_API_KEY. Both scripts send it in the Authorization: Bearer header.

Python

The standard library is enough. No package to install.

import json
import os
from urllib.request import Request, urlopen

URL = "https://api.dino.markets/v2/odds?league=nba&books=kalshi&markets=moneyline&start_after=2026-11-29T12:00:00Z"
request = Request(URL, headers={"Authorization": f"Bearer {os.environ['DINO_API_KEY']}"})

with urlopen(request, timeout=30) as response:
    events = json.load(response)["events"]

for event in events:
    for book in event["books"]:
        for market in book["markets"]:
            for outcome in market["outcomes"]:
                cents = round(100 / float(outcome["price"]))
                print(f"{outcome['name']}: {outcome['american']} ({cents} cents)")

The first three games, run 29 Nov 2026 at 02:41 UTC:

Salida
Cleveland Cavaliers: -113 (53 cents)
Miami Heat: +104 (49 cents)
San Antonio Spurs: -178 (64 cents)
Boston Celtics: +163 (38 cents)
Memphis Grizzlies: +156 (39 cents)
Los Angeles Lakers: -163 (62 cents)

JavaScript

Node 18 or later. Save it as kalshi.mjs and run node kalshi.mjs.

const url = "https://api.dino.markets/v2/odds?league=nba&books=kalshi&markets=moneyline&start_after=2026-11-29T12:00:00Z";
const response = await fetch(url, { headers: { Authorization: `Bearer ${process.env.DINO_API_KEY}` } });
const { events } = await response.json();

for (const event of events) {
  for (const book of event.books) {
    for (const market of book.markets) {
      for (const outcome of market.outcomes) {
        const cents = Math.round(100 / Number(outcome.price));
        console.log(`${outcome.name}: ${outcome.american} (${cents} cents)`);
      }
    }
  }
}

It prints the same lines as the Python script.

Read the cents

A yes share pays 1 dollar if the team wins, so the price in cents is 100 / decimal. The Cavaliers at 53 cents and the Heat at 49 add up to 102, so Kalshi’s margin on this game is 2 points. Kalshi prices as odds shows the sums step by step.

Change the request

Swap nba for another league from GET /v2/leagues, which is free. Set start_after to a time that suits you, or leave it out to include games in play. Add sportsbooks with books=kalshi,draftkings, or leave out books to get every book on the game.

Preguntas

Do I need a Kalshi account or Kalshi API key?

No. You send one dino.markets key. We read Kalshi's public prices and return them as odds.

Which price is it?

The order-book ask on each team's yes contract, the price you pay to buy now. It has no fee in it.

Can I get sportsbooks in the same call?

Yes. Leave out books, or list them, such as books=kalshi,draftkings. Kalshi arrives as one more book.

What does a call cost?

1 credit for a call that returns prices, for up to 100 games. The free plan has 1,000 credits a month.