Skip to content
Product Documentation

Installation

The betflux package bundles the Python client library and the betflux CLI. Python 3.10+.

For command-line use, install BetFlux as an isolated uv tool:

Terminal window
uv tool install betflux
betflux --version
betflux auto-update status

Starting 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:

Terminal window
uv tool upgrade betflux

Then 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 package into your project environment with pip:

Terminal window
pip install betflux # core client + CLI
pip install "betflux[pandas]" # adds pandas for .df() DataFrames
pip 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:

Terminal window
uvx betflux keys check

pip 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 pl
df = pl.DataFrame(bf.closing_lines.rows(league="NBA", date_from="2026-04-01", date_to="2026-04-07"))

The client and CLI read two environment variables:

Terminal window
export BETFLUX_API_KEY=bfx_live_... # required — mint at betflux.ai/account/api-keys
export BETFLUX_BASE_URL=... # optional — override the API host

Both can also be passed explicitly — Client(api_key=...) in Python, betflux --api-key ... on the CLI.

Verify the setup:

Terminal window
$ betflux keys check
key valid (https://api.betflux.ai)
tier: Beta — 120 requests/min
usage: 12,345 rows this month (no row cap on this plan)

This calls GET /v1/me with your key and prints your tier, rate limit, and monthly row usage (with the reset date, when your plan has a row cap).