IBKR Flex Query einrichten
Setting up your IBKR Flex Query
Ein IBKR Flex Query ist die erweiterte Option für Power-User — er enthält ISINs für alle Trades und ermöglicht automatischen API-Abruf. Für die meisten Nutzer reicht der Standard Activity Statement direkt aus dem IBKR-Portal. Falls du einen Flex Query einrichten möchtest, gibt es zwei Wege:
An IBKR Flex Query is the advanced option for power users — it includes ISINs for all trades and enables automatic API refresh. For most users the Standard Activity Statement from the IBKR portal is sufficient. If you'd like to set up a Flex Query, there are two ways:
Methode A — Automatischer Abruf
Method A — Auto-fetch
Einmal einrichten, immer wieder verwenden. KapFrei ruft die Daten direkt via Flex Web Service API ab. Abfrage muss auf Jahr-bis-dato gesetzt sein.
Set up once, use every time. KapFrei fetches data directly via the Flex Web Service API. Query must be set to Year to Date.
Methode B — CSV hochladen
Method B — Upload CSV
Report in IBKR für einen bestimmten Zeitraum manuell ausführen, CSV herunterladen und in KapFrei hochladen.
Run the report manually in IBKR for a specific date range, download the CSV, and upload it to KapFrei.
Schritt 1 — Flex Query erstellen (einmalig)
Step 1 — Create the Flex Query (one-time setup)
Dieser Schritt ist für beide Methoden identisch. Du erstellst die Flex Query einmal und speicherst sie.
This step is the same for both methods. You create the Flex Query once and save it.
- Melde dich im IBKR Client Portal an.
- Log in to the IBKR Client Portal.
- Navigiere zu Reports → Flex Queries.
- Navigate to Reports → Flex Queries.
(wird ergänzt)
(to be added)
- Klicke auf „Create" / „Neue Flex Query erstellen".
- Click "Create" / "Create New Flex Query".
- Wähle den Typ Activity Flex Query.
- Select the type Activity Flex Query.
-
Aktiviere mindestens diese Sektionen:
- Trades — Kauf- und Verkaufstransaktionen
- Cash Transactions — Dividenden und Zinsen
- Open Positions — aktueller Portfoliowert (optional, aber empfohlen)
-
Enable at least these sections:
- Trades — buy and sell transactions
- Cash Transactions — dividends and interest
- Open Positions — current portfolio value (optional but recommended)
(wird ergänzt)
(to be added)
- Speichere die Query unter einem beliebigen Namen, z.B. „KapFrei 2026".
- Save the query with any name, e.g. "KapFrei 2026".
Methode A — Automatischer Abruf (aktuelles Jahr)
Method A — Auto-fetch (current year)
Für den automatischen Abruf benötigst du zwei Dinge: den Flex Token und die Query ID.
For auto-fetch you need two things: your Flex Token and the Query ID.
Zeitraum auf „Jahr-bis-dato" setzen
Set period to "Year to Date"
Einstellung nur im Web Portal sichtbar, nicht in der Mobile App.
This setting is only visible in the Web Portal, not the mobile app.
- Öffne deine gespeicherte Flex Query über Reports → Flex Queries.
- Open your saved Flex Query via Reports → Flex Queries.
- Klicke auf das Bearbeiten-Symbol (Bleistift).
- Click the edit icon (pencil).
- Setze Period → Year to Date.
- Set Period → Year to Date.
(wird ergänzt)
(to be added)
Flex Token generieren
Generate Flex Token
- Navigiere zu Settings → Flex Web Service → Manage Tokens.
- Navigate to Settings → Flex Web Service → Manage Tokens.
- Klicke auf „Create Token". Der Token ist ein langer alphanumerischer String — kopiere ihn.
- Click "Create Token". The token is a long alphanumeric string — copy it.
(wird ergänzt)
(to be added)
Query ID ermitteln
Find your Query ID
- Gehe zu Reports → Flex Queries und öffne deine Query.
- Go to Reports → Flex Queries and open your query.
- Die Query ID ist die 6-stellige Zahl in der Browser-URL (z.B.
...queryId=123456...). - The Query ID is the 6-digit number in the browser URL (e.g.
...queryId=123456...).
(wird ergänzt)
(to be added)
Methode B — CSV manuell exportieren (Vorjahre)
Method B — Manual CSV export (prior years)
Für Vorjahre oder wenn der automatische Abruf gesperrt ist (IBKR Cooldown): Report direkt in IBKR ausführen, CSV herunterladen und hochladen.
For prior years or when auto-fetch is throttled (IBKR cooldown): run the report directly in IBKR, download the CSV, and upload it.
Empfehlung zur Archivierung: Speichere den CSV-Export auch lokal (z.B. in der Cloud) — du benötigst ihn möglicherweise später für steuerliche Prüfzwecke.
Archiving tip: Keep the CSV export locally too (e.g. in cloud storage) — you may need it later for tax audit purposes.
- Navigiere zu Reports → Flex Queries.
- Navigate to Reports → Flex Queries.
- Wähle deine gespeicherte Query aus.
- Select your saved query.
- Klicke auf „Run" (Ausführen-Symbol).
- Click "Run" (the run/play icon).
- Wähle den Zeitraum: Custom Date Range → 01.01.{Jahr} bis 31.12.{Jahr}.
- Choose period: Custom Date Range → 01/01/{year} to 12/31/{year}.
(wird ergänzt)
(to be added)
- Wähle als Format CSV.
- Select format CSV.
- Klicke „Run" — der Download startet automatisch.
- Click "Run" — the download starts automatically.
(wird ergänzt)
(to be added)
Lade die heruntergeladene .csv-Datei dann in KapFrei im Tab „CSV-Datei hochladen" hoch.
Then upload the downloaded .csv file in KapFrei on the "Upload CSV file" tab.
Mehrere verknüpfte Konten (z.B. nach IBKR-Kontomigration)? → FAQ: Multi-Account-Setup
Multiple linked accounts (e.g. after IBKR account migration)? → FAQ: Multi-account setup
Häufige Fragen
Frequently asked questions
Warum funktioniert der automatische Abruf gerade nicht?
Why is auto-fetch not working right now?
IBKR begrenzt die Häufigkeit von API-Abrufen. Nach mehreren Abrufen in kurzer Zeit tritt eine Sperre ein (IBKR Error 1001). Diese dauert typischerweise einige Stunden bis zu einem Tag. Lösung: CSV manuell exportieren (Methode B).
IBKR limits the frequency of API fetches. After several fetches in a short period, a cooldown kicks in (IBKR Error 1001). This typically lasts a few hours to a day. Solution: export CSV manually (Method B).
Welche Flex Query Sektionen sind Pflicht?
Which Flex Query sections are required?
Trades und Cash Transactions sind Pflicht. Open Positions ist optional — ohne werden FIRE-Dashboard-Werte über Yahoo Finance geschätzt, was bei europäischen Aktien weniger zuverlässig ist.
Trades and Cash Transactions are required. Open Positions is optional — without it, FIRE dashboard values are estimated via Yahoo Finance, which is less reliable for European stocks.
Kann ich die Mobile App verwenden?
Can I use the mobile app?
Für den einmaligen Setup (Query erstellen, Zeitraum auf Jahr-bis-dato setzen) empfehlen wir das Web Portal. Die Mobile App zeigt nicht alle Zeitraum-Optionen. Für das manuelle Ausführen einer bestehenden Query ist die App ausreichend.
For the one-time setup (creating the query, setting period to Year to Date) we recommend the Web Portal. The mobile app does not show all period options. For running an existing query manually, the app is fine.