Get Your Interactive Brokers History Into a Tracker

Interactive Brokers connects through its Flex Web Service. It takes three steps in the Client Portal and about five minutes, and it brings across your whole history rather than only the past year.

Read-only token No server in between Your whole history
DecentWealth portfolio view after an Interactive Brokers import

How to connect Interactive Brokers to a portfolio tracker

Interactive Brokers exposes personal account history through the Flex Web Service. You enable the service, generate a token, and build an Activity Flex Query that covers Trades and Cash Transactions. The tracker reads that report using the token and the Query ID. Everything below happens on one page of the Client Portal, on a phone or a computer, and the same three steps apply to any tracker that supports Flex.

Set aside five minutes, which is the whole price of never typing a trade in by hand again. Two of the three steps have a trap that only surfaces later, and both are below.

The three steps in the IBKR Client Portal

Step 1

Turn on the Flex Web Service

  1. Sign in to the IBKR Client Portal.
  2. Open the menu at the top left, then Performance & Reports, then Flex Queries.
  3. Find the Flex Web Service Configuration panel. If it already says Enabled, this step is done.
  4. If it does not, open it with the gear icon, tick Flex Web Service Status, and press Save.

Keep the page open. The next two steps are on it as well.

Step 2

Generate a token

  1. Set Expire After to 1 Year, the longest IBKR offers.
  2. Leave Valid for IP Address empty.
  3. Press Generate New Token. The token appears right there.
  4. Copy it.

Expire After is how long the sync keeps working. On the day it runs out you come back and repeat this step. An IP address would tie the token to one network, and a phone moves between them.

Step 3

Create the Activity Flex Query

  1. On the same page, find Activity Flex Query and press the plus button.
  2. Give it any name you like.
  3. Under Sections, open Trades and Cash Transactions, one at a time.
  4. In each, tick Select All and press Save at the bottom of the panel.
  5. Set Format to XML and Include Currency Rates to Yes.
  6. Press Continue, then Create.
  7. Open the info icon beside the query. Query ID is the first line.

Leave the date period alone. The tracker asks IBKR for the range it needs, whatever the query is set to.

Step 4

Paste both into the app

In DecentWealth, open Settings, then Interactive Brokers. The wizard shows the same three steps with the fields attached: the token goes on the screen that explains how to get a token, and the Query ID on the screen that explains how to build the query. The first sync reads the past year, then works backwards.

Two mistakes that break the sync

Save is not Generate New Token

Two buttons sit next to each other on that panel and only one of them makes a token. Save stores the on and off setting, then confirms with a green message saying it successfully updated your Flex Web Service status. That message reads as though the whole step is done, but no token exists until you press Generate New Token. If the sync later reports an invalid token, this is almost always why.

Activity Flex Query, not Trade Confirmation

The Flex Queries page holds two panels. Activity Flex Query is the upper one and it is the one that carries trades, dividends and cash movements. Trade Confirmation Flex Query sits below it and is a different report. A Query ID taken from the lower panel produces a statement the tracker cannot use.

What comes across, and what does not

A Flex statement carries more than a trade list. The cash side is what makes the balances match, and it is the part a manual CSV usually loses.

Imported Skipped
Trades in stocks, ETFs and funds Options
Dividends Futures
Interest and fees Bonds
Deposits and withdrawals Forex positions
Currency conversions, booked to the right balance

The skipped categories are a deliberate limit. DecentWealth does not model derivatives or currency pairs as holdings, and importing them would produce positions the rest of the app could not show correctly. An account that is mostly options or futures is not a good fit for this import.

Why the first sync takes several minutes

IBKR caps every Flex statement at 365 days, whatever dates are requested. A six year account therefore cannot arrive in one response: it arrives as six statements. DecentWealth reads the most recent year, then walks backwards a year at a time, up to 20 windows, which covers an account opened up to 20 years ago.

The walk is paced, because IBKR allows ten requests a minute per token and each statement costs two of them. The windows overlap by a day, since a trade booked near midnight can land on either side of a boundary depending on the timezone IBKR reports it in, and the broker trade ids make that overlap free.

All of it is merged and shown once, as a single preview. Confirming twenty imports in a row would be twenty times the tapping for one result. If one window fails, the walk stops and keeps what the earlier ones found, and the next sync picks up the rest.

Where your data goes during the import

Nobody in between

The request goes from your iPhone to interactivebrokers.com and back. There is no DecentWealth server in the path, because there is no DecentWealth server at all. The statement is parsed on the device.

The token stays put

It is held in the device Keychain, is excluded from iCloud sync, and is sent only to Interactive Brokers. It is not an account password and it grants no access to your login.

Read only

The Flex Web Service returns statements. It cannot place an order, move money or change a setting. The worst case for a leaked token is that someone reads a report, which is why the expiry is worth setting.

Several trackers support the Flex route, and the Client Portal work is identical for all of them. What changes is whether the statement passes through the vendor's servers on its way to you.

Preview before it imports, undo after

Nothing is written until you confirm. The preview lists what will be added, with a sample of parsed trades to spot check against your own records, and rows the app recognises from an earlier import are marked as duplicates by their broker trade id rather than added twice.

Every sync is recorded as a batch. Removing a batch deletes the transactions that sync added and leaves everything else alone, and the next sync offers them again. A sync that went wrong takes one tap to remove.

What it costs

Interactive Brokers sync is part of Premium: $59.99 a year or $9.99 a month in the United States as of 23 September 2026, with local prices set by the App Store. The free tier tracks up to 5 assets, and a synced brokerage account routinely brings in more than five positions.

The walkthrough above is readable inside the app before you subscribe. Three steps in someone else's portal is real work, and you should know about it before you pay. See full pricing.

Questions about the Interactive Brokers import

Does Interactive Brokers have an API for personal use?

For reading your own history, yes: the Flex Web Service. You create a report in the Client Portal, generate a token, and any client with that token and the Query ID can fetch the report as XML. It is separate from the trading APIs and it cannot trade. IBKR documents it here.

How far back does the import go?

IBKR hands over 365 days at a time, so the first sync reads the past year and then walks backwards year by year, up to 20 windows. That covers an account opened up to 20 years ago. The result is merged and previewed once, not confirmed window by window.

Does the app get my IBKR password?

No. You never enter IBKR credentials into DecentWealth. You paste a token you generated yourself, it is read-only, it lives in the device Keychain, it is excluded from iCloud sync, and it is sent only to Interactive Brokers.

What is not imported?

Options, futures, bonds and forex positions. DecentWealth models neither derivatives nor currency pairs as holdings. Trades in stocks, ETFs and funds come across, together with dividends, interest, fees, deposits, withdrawals and currency conversions.

The sync says my token is invalid right after I saved it

Pressing Save does not create a token, whatever the green confirmation afterwards implies. It stores the on and off setting above it. Go back to the Flex Web Service Configuration panel and press Generate New Token, then paste the value it shows. IBKR lists its Flex error codes here.

What happens when the token expires?

The sync stops working and the app asks you to generate a new one. One year is the longest expiry IBKR offers, so this is an annual visit to the Client Portal rather than a one-off. Nothing already imported is affected.

Can I undo a sync?

Yes. Each sync is a batch, and removing a batch deletes the transactions that sync added and nothing else. The next sync offers them again. Duplicates are also caught before import, by broker trade id, so running a sync twice does not double your history.

Is the Interactive Brokers sync free?

No, it is a Premium feature: $59.99 a year or $9.99 a month in the US as of 23 September 2026. The setup walkthrough is readable before you subscribe, so the three steps are visible before you decide. See full pricing.

Your trades, without the typing

Connect once and trades, dividends, interest, fees and cash movements arrive on their own. The only thing that leaves your iPhone is a read-only request to your broker.