InteractiveBrokers Admin InteractiveBrokers Admin
Back to home
Documentation

Connecting to Interactive Brokers

Set up automatic portfolio synchronization once — then it all runs on its own.

How it works

The system pulls data from your account through the official Interactive Brokers Flex Web Service. It is a read-only mechanism: the app receives ready-made reports (trade executions, account movements, open positions) but cannot trade or change anything on your account.

You need to do two things once in your IBKR portal: obtain an access token and create three Flex queries (report templates). After that, paste the token and query IDs into the app — and synchronization starts automatically.

🔒 Everything is done in the Interactive Brokers Client Portal. Your broker password is never shared with the app — only a read-only token.

What you will need

  • An active Interactive Brokers account with Client Portal access.
  • Access to Settings → Account Settings (for Flex Web Service).
  • An InteractiveBrokers Admin account (email + password).
  • 10–15 minutes for the initial setup.
Step1

Enable Flex Web Service and get a token

Log in to the Interactive Brokers Client Portal. Open the settings menu and find Flex Web Service.

  1. Go to Settings (gear icon) → Account Settings.
  2. Under Reporting, find Flex Web Service and open it.
  3. Switch the status to Enabled.
  4. Set the token lifetime (max — 1 year is recommended) and confirm.
  5. Copy the generated Current Token — a long numeric string. This is your access key.
⚠️ The token is shown only once. Store it somewhere safe. If you lose it, generate a new one in the same section.
Step2

Create three Flex queries

A Flex query is a report template: you choose which data to export and how. The app needs three separate queries. All are created under Settings → Account Settings → Flex Queries → Activity Flex Query.

For each query set the format: Format — XML, Period — Custom (the app supplies the date range). Below are the sections and fields to include in each of the three queries.

Query 1

Query 1. Trades

All stock and option executions. Section: Trades → Executions.

Fields: Required fields: Symbol, Underlying Symbol, Asset Class, Trade Date, Quantity, Trade Price, Proceeds, Commission, Buy/Sell, Put/Call, Strike, Expiry, Transaction ID, Multiplier.
Query 2

Query 2. Cash Transactions

Deposits, withdrawals, dividends, interest and withholding. Section: Cash Transactions.

Fields: Required fields: Type, Amount, Currency, FX Rate to Base, Date/Time, Transaction ID, Description.
⚠️ The FX Rate to Base field is critical: without it, deposits in a currency other than your base (e.g. CZK) will be calculated incorrectly.
Query 3

Query 3. Open Positions

A current end-of-day snapshot of the portfolio. Section: Open Positions → Summary.

Fields: Required fields: Symbol, Underlying Symbol, Asset Class, Quantity, Cost Basis, Position Value, Put/Call, Strike, Expiry, Multiplier.
💡 After saving each query, IBKR assigns it a numeric Query ID. Note all three down — you will need them in the app.
Step3

Enter the token and Query IDs in the app

Log in to InteractiveBrokers Admin and open the integration settings. Fill in the fields:

  • Flex Token — the token from step 1.
  • Query ID (Trades) — the ID of query 1.
  • Query ID (Cash Transactions) — the ID of query 2.
  • Query ID (Open Positions) — the ID of query 3.

Save. The app verifies the connection by making a test request to the Flex service.

Step4

Backfill history and enable auto sync

On first connection, run the history backfill from your account opening date. The system splits the period into chunks and downloads all data sequentially.

After the initial load, synchronization happens automatically on a schedule — several times per trading day. Nothing needs to be triggered manually.

🕐 IBKR only finalizes end-of-day data after market close, so a report for today’s date may not be available yet — that is normal.

Limits & frequently asked questions

Why can’t I export the entire history in one request?
The Flex Web Service does not return a period longer than 365 days per request. History is therefore loaded in chunks — the app does this automatically.
What does the “Statement is not available” error mean?
This happens when you request a report ending today: the current day’s data is not generated yet. By default the app uses data through yesterday inclusive.
The “Too many requests” (1018) error?
The Flex service rate-limits requests. A pause is inserted between requests; during a bulk history load this is expected and handled automatically.
Can I edit trades manually?
No. The source of truth is IBKR data. Manual edits are disabled to eliminate discrepancies. Everything shown in the app matches the broker.
Is it secure?
Yes. The Flex token only reads reports — it cannot trade or withdraw funds. Your broker password is never shared with the app.

Ready to connect your account?

Create an account and follow the guide — the initial setup takes about 15 minutes.