Alphanta

IBKR Flex Query import: connect Interactive Brokers read-only

6 min read · Updated October 20, 2026

An IBKR Flex Query import lets Alphanta read your Interactive Brokers positions and trades through IBKR's own reporting service. You never share your password, and nothing in this setup can place an order or move money.

How the IBKR Flex Query import works

Flex Queries are Interactive Brokers' reporting tool. You define a report inside your IBKR account, and the Flex Web Service returns it to whoever holds the matching token and Query ID. Alphanta uses that pair to request the report, waits while IBKR builds it and then reads three sections: open positions, trades and net asset value.

It is a one-way, read-only channel. A Flex token cannot sign in to your account, place or cancel orders, or request a withdrawal. Alphanta never asks for your IBKR username or password, and you can cut access from the IBKR side at any time. IBKR import is part of the Pro plan.

Step 1: create an Activity Flex Query in IBKR

The query decides what IBKR puts in the report. Alphanta expects an Activity Flex Query in XML format.

  1. Sign in to IBKR Client Portal and open Performance & Reports → Flex Queries.
  2. Next to Activity Flex Query, click the plus icon to create a new query and give it a name you will recognise.
  3. In Sections, add Open Positions, Trades and Net Asset Value (NAV) in Base. In each section, Select All is the simplest choice.
  4. Under Delivery Configuration, set Format to XML and Period to Last 365 Calendar Days.
  5. Under General Configuration, keep the default date format (yyyyMMdd), time format (HHmmss) and the semicolon date/time separator. Alphanta also reads dd/MM/yyyy dates.
  6. Save the query. IBKR shows a numeric Query ID next to it; copy that number.

Step 2: generate a Flex Web Service token

The token is what allows a report to be fetched without your password.

  1. On the same Flex Queries page, open Flex Web Service Configuration and make sure the service is enabled.
  2. Generate a new token and choose how long it stays valid. Note the expiry date; after it you will need a new token.
  3. Leave the IP address restriction empty. Alphanta requests reports from its own servers, so a token limited to your home IP address will be refused.
  4. Copy the token and keep it like a key: anyone who has both the token and the Query ID can read that report.

Step 3: connect the query in Alphanta

With the two values copied, the rest takes a minute.

  1. Open Settings → Integrations. On mobile, go to More → Connections → IBKR integration.
  2. Paste the token into Flex Web Service Token and the number into Query ID. Account ID is optional.
  3. Click Save. After saving, Alphanta shows only the last four characters of the token.
  4. Click Test connection. Alphanta sends a request to IBKR and shows either a success message or IBKR's own error text.
  5. Turn on Enable IBKR portfolio to add your IBKR account to the portfolio selector, then click Sync to run the first import.

What Alphanta reads from the report

Alphanta reads only the fields it needs to build your record:

Nothing is ever sent back to IBKR. The data feeds your totals, your allocation and the Trades view.

Sync timing and troubleshooting

Alphanta asks for a fresh report when you click Sync or refresh the Trades view. IBKR builds the report on its side, so a sync can take a minute or two. Activity reports follow IBKR's daily statement cycle: syncing the morning after a trading day picks up the latest statement, while pressing Sync again and again brings no newer data and can run into IBKR's request limit.

If something goes wrong, the message usually points to one of these:

Questions

Can Alphanta place trades in my IBKR account?

No. A Flex token can only return reports. It cannot place or cancel orders, change settings or move money, and Alphanta has no other connection to your account.

Does Alphanta need my IBKR password?

No. You only paste a Flex Web Service token and a Query ID. Alphanta never asks for your IBKR username, password or two-factor codes.

How do I revoke access?

In IBKR Client Portal, disable the Flex Web Service or delete the Flex Query. Without them, the token and Query ID saved in Alphanta can no longer return a report.

How often does Alphanta import?

Whenever you click Sync in Settings → Integrations or refresh the Trades view. Once a day, after IBKR has prepared its daily statement, is enough to keep the record current.

Try it in Alphanta — the Free plan covers one portfolio with no time limit.

More guides

Educational content about using the software. Examples use sample numbers. Not investment advice.