Skip to content
← Blog

How to share your Interactive Brokers portfolio read-only with a Flex Query

Interactive Brokers doesn’t hand out ordinary read-only API keys. Instead you build a Flex Query, a saved report of your positions and trades, and generate a Flex Web Service token that can fetch it. The token can only download reports: it can’t trade or move money.

1. Build the Flex Query

  1. Log in to the IBKR Client Portal and open Performance & Reports → Flex Queries.
  2. Create a new Activity Flex Query and name it, for example “Stock Locker”.
  3. Add the Open Positions and Trades sections, with all their fields selected.
  4. Set the period to Last 365 Days, the longest IBKR allows, and the time zone to UTC so your trades are dated correctly.
  5. Save the query and note its Query ID.

2. Generate the token

  1. On the Flex Queries page, open Flex Web Service settings.
  2. Turn the service on and generate a token. Leave any IP restriction empty when the service reads from its own servers.
  3. Copy the token. Tokens last a year at most.

Connect it to Stock Locker

On the Connect accounts page, choose Interactive Brokers and paste the Query ID and the token. IBKR builds the report on request, so the first connection can take a few seconds. Stock Locker shows shares and ETFs; options, futures and other derivatives aren’t included.

Why connect a broker at all? Because a record read from the account is the only one nobody can fake. How to build a verified track record.

Frequently asked questions

Can a Flex Web Service token trade in my IBKR account?

No. A Flex token can only fetch the Flex reports you've set up. It can't place orders, withdraw or transfer anything.

How far back can a Flex Query go?

Up to the last 365 days. Set the query's period to Last 365 Days to bring in a full year of trades.

Does my Flex token expire?

Yes, after a year at most. When it does, generate a new one in Flex Web Service settings and update it wherever you use it.

This article is general information, not investment advice. Past performance does not guarantee future results, and every trade can lose money.