Skip to content
Product Documentation

Quickstart

The API lives at https://api.betflux.ai. Dataset payloads are per-game Parquet files; the betflux CLI is the fastest way to query them. Start with an active BetFlux account. Access is currently invite-based — join the Discord if you need an invite. After signup, Getting started walks you through the same setup below.

  1. Install the CLI.

    Install uv first (optional)

    Skip this if you already have uv. On macOS or Linux, run:

    Terminal window
    curl -LsSf https://astral.sh/uv/install.sh | sh

    Restart your terminal after installation. uv will also install Python if needed. For Windows and other options, see the uv installation guide.

    Terminal window
    uv tool install betflux

    Automatic CLI updates are enabled by default on Linux and macOS. See CLI updates for controls and supported installations.

    See Installation.

  2. Authenticate the CLI.

    Terminal window
    betflux login

    Enter the terminal code in your browser and select Approve access. The CLI saves a key in your system keychain for CLI commands and Python clients. Run betflux keys check to verify access. See Browser login.

  3. Install the agent plugin. Choose the command for your agent:

    Terminal window
    betflux plugin install --codex

    Your agent’s CLI must already be installed. Start a new agent session after installation. See AI agents for other agents and setup details.

  4. Find games. Game ids are readable — LEAGUE_AWAY_HOME_YYYYMMDD — and betflux games is how you discover them. Each row is the full game record: schedule, teams, score, venue, and weather.

    Terminal window
    betflux games --league MLB --date-from 2026-07-01 --date-to 2026-07-07
  5. Pull a dataset. Fetch one game’s graded market results, filtered and rendered locally:

    Terminal window
    betflux get market-results --game MLB_BOS_NYY_20260715 --operator FANDUEL

    Or a date range — the CLI discovers the games, downloads each game’s file, and applies your filters client-side:

    Terminal window
    betflux get closing-lines --league MLB \
    --date-from 2026-07-01 --date-to 2026-07-07 --market-type MONEYLINE

Each dataset is served at GET /v1/games/{game_id}/{dataset} as a Parquet file. curl saves it; DuckDB queries it:

Terminal window
curl -s "https://api.betflux.ai/v1/games/MLB_BOS_NYY_20260715/market-results" \
-H "Authorization: Bearer $BETFLUX_API_KEY" -o results.parquet
duckdb -c "SELECT operator, market_type, side, closing_odds, outcome
FROM 'results.parquet'
WHERE market_type = 'MONEYLINE'
AND closing_odds IS NOT NULL AND closing_ts < game_start"

The closing-field filters keep this example to selections with a pre-game quote, including when reading a historical v2 artifact. In v3, live-only selections remain in market-results with a graded outcome and null closing fields.

DuckDB can also query the authenticated URL directly, without downloading — see Response formats.

  • Authentication — key format, beta access, and error semantics.
  • Datasets — what each dataset contains and how it’s built.
  • Rate limits & quotas — per-minute limits and how games per billing period are counted.