kalshi

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Kalshi — Prediction Markets

Kalshi — 预测市场

Setup

设置

Before first use, check if the CLI is available:
bash
which sports-skills || pip install sports-skills
If
pip install
fails with a Python version error, the package requires Python 3.10+. Find a compatible Python:
bash
python3 --version  # check version
首次使用前,检查CLI是否可用:
bash
which sports-skills || pip install sports-skills
如果
pip install
因Python版本错误失败,说明该包需要Python 3.10+版本。请找到兼容的Python版本:
bash
python3 --version  # 检查版本

If < 3.10, try: python3.12 -m pip install sports-skills

如果版本 < 3.10,尝试:python3.12 -m pip install sports-skills

On macOS with Homebrew: /opt/homebrew/bin/python3.12 -m pip install sports-skills

在装有Homebrew的macOS上:/opt/homebrew/bin/python3.12 -m pip install sports-skills

No API keys required.
无需API密钥。

Quick Start

快速开始

Prefer the CLI — it avoids Python import path issues:
bash
sports-skills kalshi get_markets --series_ticker=KXNBA
sports-skills kalshi get_events --series_ticker=KXNBA --status=open
Python SDK (alternative):
python
from sports_skills import kalshi

markets = kalshi.get_markets(series_ticker="KXNBA")
event = kalshi.get_event(event_ticker="KXNBA-26FEB14")
优先使用CLI——可避免Python导入路径问题:
bash
sports-skills kalshi get_markets --series_ticker=KXNBA
sports-skills kalshi get_events --series_ticker=KXNBA --status=open
Python SDK(替代方案):
python
from sports_skills import kalshi

markets = kalshi.get_markets(series_ticker="KXNBA")
event = kalshi.get_event(event_ticker="KXNBA-26FEB14")

Commands

命令列表

get_exchange_status

get_exchange_status

Get exchange status (trading active, maintenance). No params.
获取交易所状态(交易是否活跃、是否维护中)。无参数。

get_exchange_schedule

get_exchange_schedule

Get exchange operating schedule. No params.
获取交易所运营时间表。无参数。

get_series_list

get_series_list

Get all available series.
  • category
    (str, optional): Filter by category
  • tags
    (str, optional): Filter by tags
获取所有可用的系列产品。
  • category
    (字符串,可选):按类别筛选
  • tags
    (字符串,可选):按标签筛选

get_series

get_series

Get details for a specific series.
  • series_ticker
    (str, required): Series ticker (see table below)
获取特定系列产品的详细信息。
  • series_ticker
    (字符串,必填):系列代码(见下方表格)

get_events

get_events

Get events with optional filtering.
  • limit
    (int, optional): Max results (default: 100, max: 200)
  • cursor
    (str, optional): Pagination cursor
  • status
    (str, optional): Filter by status ("open", "closed", "settled")
  • series_ticker
    (str, optional): Filter by series ticker
  • with_nested_markets
    (bool, optional): Include nested markets
获取赛事信息,支持可选筛选。
  • limit
    (整数,可选):最大结果数(默认:100,上限:200)
  • cursor
    (字符串,可选):分页游标
  • status
    (字符串,可选):按状态筛选("open"、"closed"、"settled")
  • series_ticker
    (字符串,可选):按系列代码筛选
  • with_nested_markets
    (布尔值,可选):包含嵌套市场

get_event

get_event

Get details for a specific event.
  • event_ticker
    (str, required): Event ticker
  • with_nested_markets
    (bool, optional): Include nested markets
获取特定赛事的详细信息。
  • event_ticker
    (字符串,必填):赛事代码
  • with_nested_markets
    (布尔值,可选):包含嵌套市场

get_markets

get_markets

Get markets with optional filtering.
  • limit
    (int, optional): Max results (default: 100)
  • cursor
    (str, optional): Pagination cursor
  • event_ticker
    (str, optional): Filter by event
  • series_ticker
    (str, optional): Filter by series
  • status
    (str, optional): Filter ("unopened", "open", "closed", "settled")
  • tickers
    (str, optional): Comma-separated market tickers
获取交易市场信息,支持可选筛选。
  • limit
    (整数,可选):最大结果数(默认:100)
  • cursor
    (字符串,可选):分页游标
  • event_ticker
    (字符串,可选):按赛事筛选
  • series_ticker
    (字符串,可选):按系列代码筛选
  • status
    (字符串,可选):按状态筛选("unopened"、"open"、"closed"、"settled")
  • tickers
    (字符串,可选):逗号分隔的市场代码

get_market

get_market

Get details for a specific market.
  • ticker
    (str, required): Market ticker
获取特定交易市场的详细信息。
  • ticker
    (字符串,必填):市场代码

get_trades

get_trades

Get recent trades.
  • limit
    (int, optional): Max results (default: 100, max: 1000)
  • cursor
    (str, optional): Pagination cursor
  • ticker
    (str, optional): Filter by market ticker
  • min_ts
    (int, optional): After Unix timestamp
  • max_ts
    (int, optional): Before Unix timestamp
获取近期交易记录。
  • limit
    (整数,可选):最大结果数(默认:100,上限:1000)
  • cursor
    (字符串,可选):分页游标
  • ticker
    (字符串,可选):按市场代码筛选
  • min_ts
    (整数,可选):仅返回该Unix时间戳之后的记录
  • max_ts
    (整数,可选):仅返回该Unix时间戳之前的记录

get_market_candlesticks

get_market_candlesticks

Get OHLC candlestick data.
  • series_ticker
    (str, required): Series ticker
  • ticker
    (str, required): Market ticker
  • start_ts
    (int, required): Start Unix timestamp
  • end_ts
    (int, required): End Unix timestamp
  • period_interval
    (int, required): Interval in minutes (1, 60, or 1440)
获取OHLC K线数据。
  • series_ticker
    (字符串,必填):系列代码
  • ticker
    (字符串,必填):市场代码
  • start_ts
    (整数,必填):开始时间Unix时间戳
  • end_ts
    (整数,必填):结束时间Unix时间戳
  • period_interval
    (整数,必填):时间间隔(分钟),可选值为1、60或1440

get_sports_filters

get_sports_filters

Get available sports filter categories. No params.
获取可用的体育项目筛选类别。无参数。

Common Series Tickers

常用系列代码

IMPORTANT: On Kalshi, "Football" = American Football (NFL). Soccer is under "Soccer".
SportSeries TickerNotes
NBA
KXNBA
Games + futures
NFL
KXNFL
Games + futures
MLB
KXMLB
Games + futures
Champions League
KXUCL
Futures (winner)
La Liga
KXLALIGA
Futures (winner)
Bundesliga
KXBUNDESLIGA
Futures (winner)
Serie A
KXSERIEA
Futures (winner)
Ligue 1
KXLIGUE1
Futures (winner)
FA Cup
KXFACUP
Futures
Europa League
KXUEL
Futures
Conference League
KXUECL
Futures
Not all soccer leagues have futures/winner markets. EPL has match-day games but no title winner market. Use
get_sports_filters()
to discover all available competitions.
重要提示:在Kalshi平台,“Football”指美式橄榄球(NFL)。足球对应的是“Soccer”。
体育项目系列代码说明
NBA
KXNBA
常规赛 + 期货
NFL
KXNFL
常规赛 + 期货
MLB
KXMLB
常规赛 + 期货
欧冠
KXUCL
期货(冠军预测)
西甲
KXLALIGA
期货(冠军预测)
德甲
KXBUNDESLIGA
期货(冠军预测)
意甲
KXSERIEA
期货(冠军预测)
法甲
KXLIGUE1
期货(冠军预测)
足总杯
KXFACUP
期货
欧联杯
KXUEL
期货
欧协联
KXUECL
期货
并非所有足球联赛都设有冠军期货市场。英超有单场比赛市场,但没有冠军预测市场。可使用
get_sports_filters()
查询所有可用赛事。

Examples

示例

User: "What NBA markets are on Kalshi?"
  1. Call
    get_events(series_ticker="KXNBA", status="open", with_nested_markets=True)
  2. Present events with their nested markets, yes/no prices, and volume
User: "Who will win the Champions League?"
  1. Call
    get_markets(series_ticker="KXUCL", status="open")
  2. Sort by
    last_price
    descending — price = implied probability (e.g., 20 = 20%)
  3. Present top teams with
    yes_sub_title
    ,
    last_price
    , and
    volume
User: "Show me the price history for this NBA game"
  1. Get the market ticker from
    get_markets(series_ticker="KXNBA")
  2. Call
    get_market_candlesticks(series_ticker="KXNBA", ticker="...", start_ts=..., end_ts=..., period_interval=60)
  3. Present OHLC data with volume
用户:“Kalshi上有哪些NBA市场?”
  1. 调用
    get_events(series_ticker="KXNBA", status="open", with_nested_markets=True)
  2. 展示赛事及其嵌套市场、涨跌价格和交易量
用户:“谁会赢得欧冠冠军?”
  1. 调用
    get_markets(series_ticker="KXUCL", status="open")
  2. last_price
    降序排序——价格代表隐含概率(例如:20 = 20%)
  3. 展示排名靠前的球队及其
    yes_sub_title
    last_price
    volume
用户:“给我展示这场NBA比赛的价格历史”
  1. get_markets(series_ticker="KXNBA")
    中获取市场代码
  2. 调用
    get_market_candlesticks(series_ticker="KXNBA", ticker="...", start_ts=..., end_ts=..., period_interval=60)
  3. 展示包含交易量的OHLC数据

Troubleshooting

故障排除

  • sports-skills
    command not found
    : Package not installed. Run
    pip install sports-skills
    . If pip fails with a Python version error, you need Python 3.10+ — see Setup section.
  • ModuleNotFoundError: No module named 'sports_skills'
    : Same as above — install the package. Prefer the CLI over Python imports to avoid path issues.
  • Empty market results: Use
    status="open"
    to filter for active markets. Default returns all statuses including settled/closed.
  • Series ticker unknown: Check the Common Series Tickers table above. Use
    get_sports_filters()
    to discover categories, but note: "Football" = NFL, "Soccer" = football/soccer. Not all soccer leagues have futures markets.
  • "Football" returned NFL, not soccer: Kalshi categorizes American Football as "Football" and soccer as "Soccer". Use
    KXUCL
    ,
    KXLALIGA
    , etc. for soccer — see tickers table.
  • Pagination: Default limit is 100. If results are truncated, use the
    cursor
    value from the response to fetch the next page.
  • Candlestick timestamps:
    start_ts
    and
    end_ts
    must be Unix timestamps (seconds).
    period_interval
    is in minutes: 1 (1-min), 60 (1-hour), or 1440 (1-day).
  • sports-skills
    命令未找到
    :未安装该包。请运行
    pip install sports-skills
    。如果pip因Python版本错误失败,说明你需要Python 3.10+版本——请查看“设置”部分。
  • ModuleNotFoundError: No module named 'sports_skills'
    :同上——请安装该包。优先使用CLI而非Python导入,可避免路径问题。
  • 返回空的市场结果:使用
    status="open"
    筛选活跃市场。默认会返回所有状态的市场,包括已结算/关闭的。
  • 未知系列代码:请查看上方“常用系列代码”表格。可使用
    get_sports_filters()
    探索所有类别,但请注意:“Football”指NFL,“Soccer”指足球。并非所有足球联赛都有期货市场。
  • 返回的“Football”是NFL而非足球:Kalshi将美式橄榄球归类为“Football”,足球归类为“Soccer”。足球相关请使用
    KXUCL
    KXLALIGA
    等代码——见上方代码表格。
  • 分页问题:默认结果上限为100条。如果结果被截断,请使用响应中的
    cursor
    值获取下一页数据。
  • K线时间戳问题
    start_ts
    end_ts
    必须为Unix时间戳(秒)。
    period_interval
    为分钟数:1(1分钟)、60(1小时)或1440(1天)。

API

API

  • Base URL:
    https://api.elections.kalshi.com/trade-api/v2
  • All endpoints are public, read-only. No authentication required.
  • 基础URL
    https://api.elections.kalshi.com/trade-api/v2
  • 所有端点均为公开只读,无需身份验证。