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.

  1. Get a key. Sign in at betflux.ai (access is currently invite-based — join the Discord if you need an invite), subscribe on the billing page, then mint a key at betflux.ai/account/api-keys. The key is shown once — store it somewhere safe.

  2. Install the CLI and check the key. Use uv’s isolated tool install to keep the CLI separate from your Python project:

    Terminal window
    uv tool install betflux
    export BETFLUX_API_KEY=bfx_live_...
    betflux keys check

    Automatic CLI updates are enabled by default on Linux and macOS. If you need the Python SDK in an active environment, see Installation.

    key valid (https://api.betflux.ai)
    tier: Beta — 120 requests/min
    usage: 0 rows this month (no row cap on this plan)
  3. Install the agent plugin. Choose the command for your agent:

    Terminal window
    betflux plugin install --claude

    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:

    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.