Installation
The betflux package bundles the Python client library and the betflux CLI.
Python 3.10+.
Install the CLI
Section titled “Install the CLI”For command-line use, install BetFlux as an isolated uv tool:
uv tool install betfluxbetflux --versionbetflux auto-update statusStarting with BetFlux 0.3.0, automatic stable-release updates are enabled
by default for verified uv tool install betflux installations on Linux and
macOS. If you installed the CLI with uv before 0.3.0, run this once to get the
updater:
uv tool upgrade betfluxThen verify that betflux --version reports 0.3.0 or later and
betflux auto-update status reports updates are on. uv preserves the version
constraint from your original installation. If it excludes 0.3.0, revise the
pin deliberately before upgrading.
Updates run before data commands and may occasionally delay startup. They use
uv’s saved package source and version constraints. Automatic updates do not
run for Windows, pip or editable installs, or temporary uvx commands.
Importing the Python SDK never checks for or installs updates.
Disable updates in CI or for reproducible scripts by setting
BETFLUX_NO_AUTO_UPDATE=1 for the process. For persistent settings and manual
updates, see CLI updates.
Install the Python SDK
Section titled “Install the Python SDK”Install the Python package into your project environment with pip:
pip install betflux # core client + CLIpip install "betflux[pandas]" # adds pandas for .df() DataFramespip install "betflux[polars]" # adds polars — build frames from .rows()The pip install also provides the CLI, but pip, editable, and project installs do not update automatically. For an isolated CLI, use uv as shown above.
Run a one-off command without installing a tool:
uvx betflux keys checkpip install betflux-cli also works — it is an alias that depends on
betflux, so either name gives you the same library and the same CLI. For
automatic updates, use a supported uv tool installation that exposes the
betflux command.
The core install includes pyarrow — dataset payloads are per-game Parquet files, and the SDK parses and filters them locally, so it’s a required dependency rather than an extra.
.df() is pandas-only. The [polars] extra just installs polars alongside
the client — build the frame yourself from .rows():
import polars as pldf = pl.DataFrame(bf.closing_lines.rows(league="NBA", date_from="2026-05-01", date_to="2026-05-07"))Configuration
Section titled “Configuration”Sign in through your browser to save a key for CLI commands and Python clients:
betflux loginEnter the terminal code on the website and select Approve access. See Browser login for the full walkthrough, headless setup, and logout.
You can also configure the client and CLI with environment variables:
export BETFLUX_API_KEY=bfx_live_... # optional — overrides saved loginexport BETFLUX_BASE_URL=... # optional — override the API hostBoth can also be passed explicitly — Client(api_key=...) in Python,
betflux --api-key ... on the CLI.
Verify the setup:
betflux keys checkThis calls GET /v1/me with your key and reports your connection, plan,
limits and the period’s games usage.