OKX connects to Viktury in one of two ways. A read-only API key keeps the account up to date by itself. If you would rather not create a key, you can upload your trading history export from OKX instead.
The key lets Viktury read your history and balances. It cannot trade and it cannot withdraw, because you only tick Read.
Create the key
-
Sign in at okx.com, or at my.okx.com if your account is with OKX in the EEA. Create the key on the site you sign in to. Viktury works out which site it belongs to on its own.
-
Open your profile, choose "API and connections" and click "Create API key".
-
Give the key a name. Under "Permissions" tick only "Read" and leave "Trade" and "Withdraw" off.
-
Set a passphrase and keep a note of it. OKX cannot show it to you again.
-
Optional: the Add account form in Viktury shows an IP address you can add under "IP address allowlist". A read-only key works without it.
-
Copy the API key and the secret key before you close the page.
-
In Viktury, open Add account, choose OKX and paste the API key, the secret key and your passphrase.
When you add the key, Viktury checks it with OKX. A key that can trade or withdraw is turned down, and nothing is saved until the key passes.
How much history you get
OKX's API serves the last 3 months, and those show up within minutes. For anything older, Viktury asks OKX for its quarterly history files. OKX prepares those on request, so older history can take a few hours to arrive, and it comes in only where OKX provides it. It may be partial. If an older period matters to you now, export it from OKX as a file (below) and upload it to the same account.
Or upload your trading history export
-
On okx.com (or my.okx.com) in a desktop browser, open "Assets", then "Order center", then "Trading history" and click "Download".
-
Keep every instrument and every account selected, and set "Date range" to start from your first trade on OKX. Any time zone works.
-
Choose CSV and click "Export". Download the file when it is ready. If OKX will not cover your whole history in one file, export each period and upload the files one by one.
-
In Viktury, open Add account, choose OKX, open the "Upload CSV" tab and upload the file as it is. Opening and saving it again in a spreadsheet app can break the import.
A file is a snapshot, so to bring the account up to date later, export again and upload it to the same account. Rows already imported are skipped, so overlapping files do no harm. You can also add an API key to an account you started with a file: both carry OKX's own id for each row, so nothing is counted twice.
A file does not say which transfers were moves between your own trading and funding accounts, so from a file alone every transfer shows as money in or out. Adding a key to the account tells them apart.
What we import
- Spot trades, including converts.
- Perpetual and futures trades as round trips, with every funding payment attached to the trade that was open when it was charged. EEA X-Perps work the same way, whichever position mode your account uses.
- Margin trades, with the interest you paid on what you borrowed.
- Deposits and withdrawals.
- Moves between your trading and funding accounts, as internal moves rather than deposits and withdrawals.
- Simple Earn interest and staking rewards, as income. Moving coins into or out of Simple Earn is not a trade: the coins stay in your holdings.
What is not supported yet
Margin borrowing and repayment rows and options are not turned into trades yet. Those rows are kept and counted, and the account says how many it could not name, so nothing is quietly dropped. Viktury leaves them out rather than guess at them.
Each OKX sub-account has its own key, so add each one as its own account.
Troubleshooting
- The key is refused. Check that you copied the API key, the secret key and the passphrase in full. If OKX shows the key with "Trade" or "Withdraw" ticked, create a new key with only "Read".
- Older history is missing. Older history arrives a few hours after the first sync, and only for the periods OKX provides. Export the missing period from OKX and upload it to the same account.
- My transfers show as deposits and withdrawals. That happens on an account with only a file. Add a read-only key and moves between your own OKX accounts stop counting as money in or out.