Guides / Kalshi sports trading bot

Kalshi sports trading bot

By the dino.markets team · Updated 3 Dec 2026

The Kalshi sports trading bot is one open source Python file. It prints every game where Kalshi’s price is 5 points or more away from the sportsbook fair price, and with --trade it buys the cheap side from your own Kalshi account.

Get the bot and a key

You need Python 3.9 or newer and a dino.markets API key. The Free plan has 1,000 credits a month and needs no card. Get a key, then:

git clone https://github.com/dino-markets/kalshi-sports-trading-bot
cd kalshi-sports-trading-bot
export DINO_API_KEY=your-api-key

Run it and read the table

Name the leagues to read and the smallest gap to print. This run read the NFL and printed gaps of 3 points or more.

python3 bot.py --league nfl --min-gap 3

The whole answer on 3 Dec 2026 at 00:45 UTC:

Output
Game                                       Starts (UTC)      Side                   Kalshi  Fair   Gap   Books
Green Bay Packers at New Orleans Saints    2026-12-06 18:00  Green Bay Packers      0.730   0.688  -4.1  57
Washington Commanders at Tennessee Titans  2026-12-06 18:00  Washington Commanders  0.680   0.642  -3.8  57
Green Bay Packers at New Orleans Saints    2026-12-06 18:00  New Orleans Saints     0.280   0.312  +3.1  57
Denver Broncos at New York Jets            2026-12-13 18:00  Denver Broncos         0.630   0.600  -3.0  46

Kalshi is the price of one contract that pays $1 if that side wins. Fair is what the sportsbooks say that side is worth. Gap is Fair minus Kalshi, in points of probability, so a positive gap means Kalshi is cheaper than the sportsbooks and a negative gap means it is dearer. Books is the number of sportsbooks behind the fair price.

How the fair price is built

A sportsbook’s prices for the two sides of a game add up to more than 100%. The extra is the book’s margin. The bot removes it in three steps:

  1. Turn each decimal price into a probability, 1 divided by the price.
  2. Divide each probability by the book’s total, so the book adds up to exactly 100%.
  3. Take the median across all sportsbooks for each side.

Only sportsbooks count. Prediction markets and betting exchanges are left out. Implied probability and the vig explains the margin.

See where the prices come from

The bot makes one request for each league. The answer holds every sportsbook and Kalshi for the same game, so nothing has to be matched by team name.

curl "https://api.dino.markets/v2/odds?league=nfl&markets=moneyline&books=kalshi&limit=1" \
  -H "Authorization: Bearer $DINO_API_KEY"

The Kalshi part of the answer on 3 Dec 2026:

{
  "key": "kalshi",
  "name": "Kalshi",
  "markets": [
    {
      "key": "moneyline",
      "period": "game",
      "line": null,
      "main": true,
      "updated_at": "2026-12-03T00:31:10Z",
      "outcomes": [
        {
          "name": "Los Angeles Rams",
          "participant_id": "p_jxucgly",
          "side": "home",
          "price": "2.128",
          "american": "+113",
          "market_id": "KXNFLGAME-26DEC03KCLAR-LAR"
        },
        {
          "name": "Kansas City Chiefs",
          "participant_id": "p_jmdgybh",
          "side": "away",
          "price": "1.852",
          "american": "-117",
          "market_id": "KXNFLGAME-26DEC03KCLAR-KC"
        }
      ]
    }
  ]
}

price is decimal odds, so the Rams at 2.128 are a contract price of 1 / 2.128, or 47 cents. market_id is the ticker of the Kalshi market for that side. The bot sends it with the order, so the order goes to the same market the price came from.

Turn on trading

Without --trade the bot only reads prices. To place orders, install the package that signs requests and give the bot your Kalshi API key:

pip install cryptography
export KALSHI_API_KEY_ID=your-key-id              # Kalshi, Account and security, API Keys
export KALSHI_PRIVATE_KEY_PATH=~/kalshi-key.key   # the key file Kalshi gave you
python3 bot.py --league nfl --trade --stake 5 --max-orders 3

For each side whose gap is --min-gap or more, the bot buys as many contracts as --stake dollars covers, at the price in the table or better. Fees come on top. An order fills at once or is cancelled, so nothing is left on the book. It skips games in play and never sells.

Each order is written to orders.json before it is sent. A market recorded there as bought is skipped on later runs, and so is one whose answer never came back, until you check your account and remove its entry. A market where nothing was bought is tried again. Your Kalshi key file stays on your computer and only signs the requests sent to Kalshi.

The order step is new. Start with the default $5 stake. Each order prints bought, none or check.

Work out the cost

A run costs 1 credit for each league, up to 100 games. One league every 10 minutes is 144 credits a day, so the Free plan’s 1,000 credits cover about a week of that. Pricing lists the plans.

Limits

  • The gap and the price cap leave out Kalshi’s fees and the cost of moving money in and out.
  • A large gap can be a stale price, or news that one side has not caught up with.
  • You can lose money. This is a tool and not advice.

The same bot for Polymarket is the Polymarket sports trading bot.

Questions

Do I need a Kalshi key to run it?

Not for the table. The table needs only a dino.markets key. A Kalshi key is needed only when you add --trade.

Does the bot ever sell?

No. It only buys a side that Kalshi prices below the sportsbook fair price. Closing a position is up to you.

Can it leave an order open on the book?

No. Each order fills at once or is cancelled, at the price in the table or better.

What does a run cost?

One credit for each league it reads. The Free plan has 1,000 credits a month.