Skip to main content

PyFlexWeb

CLI for downloading IBKR Flex reports.

CI PyPI version

Install

uv tool install pyflexweb

Setup

  1. Create a Flex Query and generate a token in your IBKR Account Management portal.

  2. Store your token and add queries:

pyflexweb token set YOUR_TOKEN

# Add an activity query (default type, 6h download interval)
pyflexweb query add 123456 --name "Daily activity"

# Add a trade confirmation query (1h download interval)
pyflexweb query add 789012 --name "Trade confirmations" --type trade-confirmation

Multi-Account Support

If you have multiple IBKR accounts, each with its own Flex token, you can configure per-account tokens and associate queries with specific accounts:

# Add accounts
pyflexweb account add U1317359 --name "Cerabella" --token YOUR_TOKEN_1
pyflexweb account add U11049821 --name "CCUK" --token YOUR_TOKEN_2

# List configured accounts
pyflexweb account list

# Add queries tied to specific accounts
pyflexweb query add 111111 --name "Cerabella Activity" --account U1317359
pyflexweb query add 222222 --name "CCUK Activity" --account U11049821

# Rename or remove accounts
pyflexweb account rename U1317359 "Main Account"
pyflexweb account remove U11049821

Token Resolution

When downloading, pyflexweb resolves the token for each query:

  1. Look up the account associated with the query
  2. Use that account's token
  3. If the account has no token configured, the query is skipped with a clear error

Every query must be associated with an account (--account is required when adding queries). Legacy global tokens are automatically migrated to a placeholder account on first run.

Usage

# Download all queries that are due
pyflexweb download

# Download a specific query
pyflexweb download --query 123456

# Force download regardless of interval
pyflexweb download --force

# Check status of all queries
pyflexweb status

Commands

token set|get|unset          Manage IBKR token (global fallback)
account add <id> --token T   Add account (--name optional)
account list                 List configured accounts
account remove|rename <id>   Remove or rename an account
query add <id> --name "..."  Add query (--type, --min-interval, --account)
query remove|rename <id>     Remove or rename a query
query interval <id> [hours]  Set per-query download interval (--unset to revert)
query list [--json]          List queries with status
download                     Download reports (--query ID, --force, --output, --output-dir)
status                       Alias for query list
config set|get|unset|list    Manage defaults (output_dir, poll_interval, max_attempts)

Query Types

Type Default Interval
activity 6 hours
trade-confirmation 1 hour

Per-query overrides: pyflexweb query interval 123456 12 (set to 12h)

Publishing

make version bumps the patch version, commits, tags, and pushes. GitHub Actions publishes to PyPI on any v* tag.

License

GPL-3.0-or-later

Metadata

Release files for pyflexweb 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyflexweb 0.4.1
File Size Uploaded Provenance Actions
pyflexweb-0.4.1.tar.gz 39.8 kB With provenance Details for pyflexweb-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyflexweb 0.4.1
File Interpreter ABI Platform Actions
pyflexweb-0.4.1-py3-none-any.whl Python 3 none any Details for pyflexweb-0.4.1-py3-none-any.whl

Total release size: 68.8 kB

Release files / pyflexweb-0.4.1.tar.gz

Download URL pyflexweb-0.4.1.tar.gz
Size 39.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a11716a908fe147b395e0557e6da7d8f0a7a0efa8380d750b56f0896cd288928
BLAKE2b-256 checksum
How to use checksums
b3c1adeaf6c1f16897391855f72acae8f27c855e3227ea82776fd6751308e3b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.

Transparency log

Release files / pyflexweb-0.4.1-py3-none-any.whl

Download URL pyflexweb-0.4.1-py3-none-any.whl
Size 29.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ee5becdba9d17b9d6108195bc3e681978cbded367da2769399015de96bc5e7b
BLAKE2b-256 checksum
How to use checksums
d6e1e5fe3af0a8a5b5b8276b8ac98c0af358d0c624e12bba2ba325a128e71019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.

Transparency log

Security for pyflexweb 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyflexweb-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page