How to export a CSV from Interactive Brokers
Download your activity statement from the IBKR Client Portal and import your full transaction history into Oitava, or connect by API to sync automatically.
Export your activity statement
Download your activity statement from the IBKR Client Portal.
- 1
Log in to Client Portal
Go to clientportal.ibkr.com and log in to your account.
- 2
Open Reports
Navigate to Performance & Reports → Statements.
- 3
Generate an Activity Statement
Select "Activity" as the statement type, set your date range to cover your full history, and choose CSV as the format.
- 4
Download and import
Click Run, then download the file. Upload it in Oitava's import dialog.
API sync (optional)
Prefer automatic sync to uploading CSV files? Connect your Interactive Brokers account with a read only Flex Web Service token and Oitava keeps your portfolio up to date.
IBKR sync needs two things from the Client Portal: an Activity Flex Query that says which data to send, and a Flex Web Service token that lets Oitava request it. You set this up once, after that syncing is automatic and you never need to come back here.
- 1
Open the Flex Web Service settings
In Client Portal, go to Performance & Reports → Flex Queries. On the right, in the Flex Web Service Configuration panel: (1) click the gear icon.

- 2
Enable the service and generate your token
(1) Tick Flex Web Service Status. (2) Click Generate New Token, an "Expire after" dropdown appears, so choose 1 year, because the default of 6 hours would stop your sync working the same day. (3) Click Save. (4) Copy the Current Token. Leave "Valid for IP Address" empty.

- 3
Start the AI query builder
Go back to Flex Queries. In the Configure with AI panel at the top: (1) click Configure with AI.

- 4
Paste this prompt
(1) Paste the following into the description box, then (2) click Generate Flex Query: "Activity Flex Query, XML, period Last 365 Calendar Days. Sections: Trades, Cash Transactions, Corporate Actions, Financial Instrument Information, Include Currency Rates. Select all fields in each" IBKR limits this box to 200 characters, so the prompt is written to fit.

- 5
Switch on Include Currency Rates
The AI ignores this one, so it needs setting by hand. On the Review Flex Query screen: (1) click Edit Manually, (2) find "Include Currency Rates?" under General Configuration and set it to Yes, (3) click Save. This lets Oitava use IBKR's own exchange rates for your transactions instead of estimating them.

- 6
Copy the Query ID
At the top of Review Flex Query: (1) copy the Query ID, a 7-digit number. Don't confuse it with your account number, which starts with a U.

- 7
Paste both into Oitava
Enter the token and the Query ID in your portfolio's sync settings. Both are encrypted before storage and the token is read-only. It can retrieve statements but cannot trade or move money.
Ready to import?
Create a free account and import your IBKR portfolio in minutes.