IBKR Flex Query guide

How to set up an IBKR Flex Query

InteractiveFIRE reads your portfolio from an Interactive Brokers Flex Query. You create the query and a Flex Web Service token in Client Portal, then enter the Query ID and token in InteractiveFIRE. It takes about five minutes.

Free to get started. No payment details needed. Try the demo without signing up.

Step 1

Generate a Flex Web Service token

  1. Sign in to Client Portal on ibkr.com.
  2. Open Performance & Reports → Flex Queries → Configure Flex Web Service. Use the same IBKR username you will save the query under.
  3. Click Configure and generate a token.
  4. Set the expiry to the longest option, 1 Year.
  5. Copy the token and write down its expiry date.

The token can download Flex reports saved under your IBKR login. It can’t place trades, move money or change your account.

Step 2

Create the Activity Flex Query

In Performance & Reports → Flex Queries, create a new Activity Flex Query. If you have more than one account under your login, select all of them.

Report sections

Tick these six sections. In each one, select all fields, including Account ID. Account ID is only a number and is used to match each report to the right account. Fields InteractiveFIRE doesn’t use are discarded.

  • ✓
    Cash TransactionsOptions: Keep defaults, select all fields
  • ✓
    Change in Dividend AccrualsOptions: Keep defaults, select all fields
  • ✓
    Net Asset Value (NAV) in BaseOptions: Keep defaults, select all fields
  • ✓
    Open PositionsOptions: Summary, Lot, select all fields
  • ✓
    TradesOptions: Keep defaults, select all fields
  • ✓
    TransfersOptions: Keep defaults, select all fields

Optional: Statement of Funds, with all fields and each currency shown on its own, not only the base-currency total. It lets the Currency panel count cash you hold in other currencies.

Leave Account Information unticked. It holds your name and address, and InteractiveFIRE refuses any report that includes it.

Delivery settings

Period
Last 30 Calendar Days
Format
XML
Display Account Alias in Place of Account ID?
No
Advisor or family master accounts
Account-by-Account Bundle (Clients only)

InteractiveFIRE checks for a new report every day, so a 30-day period lets a few missed days catch up on their own. Older history is requested separately after the first import. IBKR keeps it for the current year and the four before it.

Step 3

Save the query and copy its Query ID

  1. Save the query. IBKR then shows its Query ID.
  2. Run the query once from Client Portal to check that it downloads.

Step 4

Add the connection in InteractiveFIRE

Create an account or sign in, then enter the Flex Web Service token, the Flex token expiry date and the Flex Query ID. From then on, InteractiveFIRE checks for a new report each day. We email you before the token expires so you can generate a new one.

Common Flex Query problems

Most setup problems come from one setting in the query. Change it in Client Portal and save the query again. The Query ID stays the same.

  1. There’s no Flex Queries menuYou’re probably in the IBKR Mobile app. Open ibkr.com in a browser instead.
  2. The report is refused for personal dataAccount Information is ticked. Untick it and save.
  3. Cost basis is missingOpen Positions needs both Summary and Lot, with all fields selected.
  4. An account is missingThe query only covers the accounts you selected. Edit it to include all of them. Free covers one IBKR account; more need Pro.
  5. The token has expiredGenerate a new one in Flex Web Service and replace it in Settings. Your Query ID doesn’t change.

Bring your IBKR portfolio in

Takes about five minutes. Free for one IBKR account.