Interactive BrokersBrokerAutomatic

How to connect Interactive Brokers

Allown reads your IBKR account through Flex Web Service, IBKR's own read-only reports. You set up one report and a token once, paste two codes into Allown, and it keeps your account in sync from then on. A second, optional report adds today's trades as you make them.

Brings in
Stocks, ETFs, Options, Bonds, Cash
How it connects
Read-only token
Time
About 10 minutes

What you need

  • An Interactive Brokers account you can log in to on the website
  • About 10 minutes
  • Your phone, in case IBKR asks you to confirm the login

Step by step

  1. Open Flex Queries

    1. Performance & Reports
    2. Flex Queries

    Log in to IBKR's website (the Client Portal, not the trading app). In the top menu, open Performance & Reports, then Flex Queries.

    This is where IBKR lets you design reports about your own account.

  2. Create an Activity Flex Query

    1. Activity Flex Query
    2. +

    Find Activity Flex Query and press the + next to it. Name it something you'll recognise, such as Allown.

    A Flex Query is a saved recipe for a report: which parts of your account go into it, and in what form.

  3. Choose the sections

    IBKR lists many sections. Allown needs the ones below. Open each, pick the option shown, tick Select All for its fields and save the section. Extra sections do no harm.

    SettingChoose
    Account InformationSelect All
    Net Asset Value (NAV) in BaseSelect All
    Open PositionsSummary
    TradesExecution
    Cash ReportCurrency level
    Statement of FundsSelect All
    Cash TransactionsDeposits & Withdrawals, Dividends, Payment in Lieu of Dividends, Withholding Tax; Detail
    TransfersInclude
    Corporate ActionsDetail
    Stock Grant ActivitySelect All

    Ticking Select All matters most for ISIN and Listing Exchange: they tell Allown exactly which share you own when two companies share a ticker.

  4. Set delivery and dates

    Under the sections, set how the report is delivered and how dates are written, so the file comes out in a shape Allown reads.

    SettingChoose
    FormatXML
    PeriodLast 365 Calendar Days
    Date FormatyyyyMMdd
    Time FormatHHmmss
    Date/Time Separator; (semi-colon)
  5. Save and note the Query ID

    Press Continue, then Create. The query appears in the list with a number next to its name: the Query ID (for example 987654). Allown uses it to ask for the right report.

  6. Optional: add today's trades

    1. Trade Confirmation Flex Query
    2. +

    The Activity report ends yesterday, so a trade you make today shows up the next morning. To see it within the hour, make a second query: find Trade Confirmation Flex Query on the same page and press +. Name it, for example Allown today, pick the options below, and note its Query ID as well.

    Allown keeps today's trades on top of yesterday's balances and replaces them with the Activity report's own rows the next day.

    SettingChoose
    Trade ConfirmationsExecution; Select All
    FormatXML
    PeriodToday
    Date FormatyyyyMMdd
    Time FormatHHmmss
    Date/Time Separator; (semi-colon)

    Both queries must list trades at the Execution level (the Trades section of the Activity query too), so each fill is counted once.

  7. Switch on Flex Web Service and copy the token

    1. Flex Web Service Configuration
    2. Generate New Token

    On the same page, open Flex Web Service Configuration (the gear icon). Switch the service on and press Generate New Token. Choose how long it lasts (the longest saves you renewing it) and copy the long number it shows: your Flex token.

    The token only downloads reports. It can't log in, trade or move money.

  8. Paste both into Allown

    In Allown, open the account you want to fill, choose Add connection and pick Interactive Brokers. Paste the Flex token and the Query ID, and the trade confirmation query's ID if you made one, then press Connect. Allown checks them with IBKR before saving anything.

Why it’s safe

  • Flex Web Service only produces reports. Nothing in it can place an order, change your account or withdraw money.
  • Allown stores the token encrypted and never shows it again, not even to you.
  • You can switch the token off in IBKR at any time, and Allown stops reading at once.

After you connect

The first sync starts right away and usually takes a minute or two: your holdings appear first, then the year of history behind them. After that Allown syncs every few hours on its own.

The Activity report ends yesterday. With the optional trade confirmation query (step 6), today's trades appear within the hour while markets are open, and the next day's report takes them over. You can add it later: open the connection's Update keys, leave the saved codes as they are and paste only the new Query ID.

A query reaches back one year. For older years, run the same query in IBKR with a custom date range, download each year as XML and upload the files on the connection (Upload statements). They slot in without doubling anything.

Questions

Why does the history stop after a year?

Flex Web Service returns at most 365 days per report. Older years come from statement files you upload, as described above.

I have several IBKR accounts under one login. What happens?

One query covers them all. Allown asks which Allown account each one should fill, or keeps them together.

Allown says a section is missing.

Open the query in IBKR, add the section it names, save, and press Sync now in Allown. Nothing needs typing again.

My token stopped working.

Tokens expire after the time you chose. Generate a new one in Flex Web Service Configuration and use Update keys on the connection.

A trade I made today isn't there.

IBKR's Activity report only covers days that are over, so a trade appears the next morning. To see it the same day, add the Trade Confirmation query from step 6 with Update keys: only its Query ID is needed.

Other integrations

See all of it in one place

Write in what you hold, upload a CSV or add a read-only connection. It takes a couple of minutes.

Get started