Learn how to securely connect your OKX account to crypto tax platforms through API integration. This guide covers step-by-step API key creation, data import capabilities, and limitations you need to know before starting—helping you maintain accurate transaction records without manual CSV uploads every month.
Log in to your OKX account and navigate to the user icon in the upper-right corner. From the drop-down menu, select API to begin the setup process.
Click + Create APIs and enter a descriptive name for your key—something like "blockpit" or "tax-tool" works well. Keep API trading selected as the purpose, and skip IP whitelisting for now to ensure smooth integration.
Grant the API key Read permissions only. This is crucial—never enable trading permissions for tax or tracking tools, as it creates unnecessary security risks.
Here's the important part: when prompted for a passphrase, enter "Blockp!t1" exactly as shown. This specific passphrase is required for many popular crypto tax platforms to authenticate properly.
Select Submit all and complete the two-factor authentication verification. Once confirmed, click Show info to reveal your API credentials.
Your API key and Secret will now appear in the API list. The Secret is displayed only once—copy it immediately and store it securely before clicking Complete.
For tax reporting and portfolio tracking, OKX's API integration offers a significant advantage over manual CSV imports. If you're managing multiple exchanges and looking for a platform that streamlines transaction tracking across all your accounts,
👉 Set up automated crypto tracking with OKX's secure API integration
Connect your newly created API credentials to your preferred tax or portfolio platform by pasting both the API key and Secret into the designated integration fields.
Critical limitation: OKX only provides transaction history for the last 3 months via API. To maintain continuous records, keep your integration active rather than deleting and recreating it. For transactions older than three months, you'll need to manually import historical CSV data using template-based uploads.
Your tax report accuracy depends entirely on having complete transaction history. API imports are the preferred method because they run automatically and reduce human error compared to manual CSV uploads.
Deposits & Withdrawals – Full tracking of all on-chain movements into and out of your OKX account
Fee Payments – Comprehensive fee records for accurate cost basis calculations
Spot Market Trades – All buy and sell orders executed on spot markets (limited to last 3 months)
Converts – Direct crypto-to-crypto conversions (limited to last 3 months)
Derivative Trades PnL – Profit, loss, fee, and funding data from futures and perpetual contracts (limited to last 1 year)
Airdrops, Bounties, Hard Forks – Free token distributions that trigger taxable events
Earn Products – Staking and lending rewards with regional variations:
EU users: On-chain Earn only
Non-EU users: Simple Earn, On-chain Earn, and Lending programs
Complete Balance Syncing – Real-time portfolio balance updates across all supported assets
Margin Trades are not supported through API import. You'll need to add these manually or migrate data using Excel templates.
Buy Crypto via Card (Express buy) transactions don't flow through the API either. Track these separately through your credit card statements and add them manually.
Spot Market Trades & Converts older than 3 months require manual import or Excel template migration to maintain complete records.
Derivative Trades older than 1 year fall outside API coverage and need alternative import methods.
If you notice missing transactions after API sync, identify them in your OKX transaction history and contact your tax platform's support team. Most platforms continuously expand their import capabilities based on user feedback.
For traders managing complex portfolios across spot, derivatives, and earn products, maintaining accurate records becomes exponentially harder without proper automation.
👉 Access OKX's comprehensive API for seamless multi-product tracking
This integration becomes particularly valuable when you're filing taxes or generating performance reports that require precise historical data.
Before analyzing any data discrepancies or dashboard warnings, always sync all integrations first, then recalculate your transaction data. This two-step process resolves most temporary inconsistencies.
If problems persist after syncing, creating a fresh integration often solves issues caused by product updates that don't automatically apply to existing connections. Create a temporary second integration to compare results, then delete whichever version contains incomplete data.
Unlabeled transactions appear when the API can't automatically categorize certain activities. You can manually label these, merge related transaction pairs into trades or transfers, or use bulk edit features to process multiple similar transactions at once.
Duplicate or incorrect transactions should be edited, excluded, or deleted through your platform's transaction management interface. This prevents calculation errors in your tax reports.
For transactions that weren't imported at all, add them individually through manual entry or upload them using your platform's Excel template feature directly to the affected integration.
Setting up OKX API integration takes just a few minutes but provides ongoing automation that saves hours during tax season. By granting read-only permissions and using the correct passphrase, you establish a secure connection that continuously imports deposits, withdrawals, trades, and earn rewards without manual intervention. While the 3-month limitation for spot trades requires supplemental CSV imports for historical data, maintaining an active integration ensures you never lose future transaction records. For traders managing diverse activities across spot markets, derivatives, and earn products, OKX's comprehensive API coverage makes it an ideal choice for automated portfolio tracking: https://www.okx.com/join/SUPER20OFF