How to export your exchange trade history

Getting the file is the easy half. What the exchange hands over is a ledger in its own terms, and a tax report needs a cost basis it never recorded.

Pull it with your own read-only key through CCXT if you want every venue in one shape, or take the exchange's own statement export if one account is the whole job. Ten cards here import an exchange account and hand it back as CSV. None of them can supply what the file is missing: a fiat cost basis for anything that arrived from somewhere else.

The short way

If you want one venue and you are not writing code, use the exchange's own statement export and skip everything below the next section. It is a form, it is free, and for a single account it is the complete answer.

If you have several venues, or you want this to run again next quarter, use a read-only key and CCXT:

import ccxt

exchange = ccxt.binance({'apiKey': 'YOUR_API_KEY', 'secret': 'YOUR_API_SECRET'})
if exchange.has['fetchMyTrades']:
    fills = exchange.fetch_my_trades('BTC/USDT', since=None, limit=1000)

Two things about that snippet. The key should have trading and withdrawal permissions switched off at the exchange — reading a history needs neither, and a key that can only read is a key worth far less to whoever eventually finds it. And the exchange.has check is not decoration: support in CCXT is per method, and the card says so plainly — an exchange can be supported and still not implement fetchMyTrades.

What the options are

Your own key. CCXT, as above, or the venue's API directly. This is the only route that scales to several exchanges and repeats on a schedule, and your keys stay in your process.

A workspace that imports the account. Ten cards in this catalogue read an exchange account and give you the history back. Altrady is the one that goes furthest: it imports trade history from an exchange to backfill its journal, and exports balances, orders or trades as CSV, one file or one per account. Read the tier before you plan on it — CSV export and the tax export are both on the top plan only, and the export is capped at 90 days per run with ten runs per rolling 30 days, so a year of records is several passes.

An older workspace with an API. Coinigy has been doing this longer than almost anything else here and exports CSV and over an API. Check its venue list against yours first: it has not been maintained, FTX International is still on it four years after the exchange collapsed, Coinbase Pro appears under its old GDAX code, and there is no Hyperliquid and no Bitget.

The institutional version. At the execution end — Talos, Elwood, Wyden — the export is not a download at all. It is an API and a settlement ledger, the record is produced as a by-product of clearing rather than requested afterwards, and getting to it means KYC, an application and a price nobody publishes. If your problem is that an auditor is asking, that is what this tier is for; see priced on request before you start.

Where this breaks

The export is rationed. Binance serves up to six months immediately with a ceiling of 10,000 data points per export; past six months it becomes a generated statement covering at most one year from the date you choose, back to 13 July 2017, and you may generate only five statements a month with the download link kept for seven days. That is a documented constraint, not a throttle you can retry through, and it means a long history is a plan with dates in it. Doing it through the API instead trades one limit for another — see rate limit for what you are actually spending.

A ledger is not a list of trades. Kraken's ledger export carries txid, time in UTC, a type covering trade, margin, earn, deposit, withdrawal and transfer, a subtype, the asset, an amount debited or credited, the fee in that asset, and the balance afterwards. One trade is therefore two rows in two assets, fees appear as their own debits, and staking rewards and transfers sit in the same file as fills. Reconciling that into "I sold 0.4 BTC for 24,000 USDT on this date" is work, and it is work that has to agree with the trade file next to it.

Fees are in the asset, and they are part of the number. They are deducted in whatever was traded, at whatever that was worth at the time, and the IRS's own guidance puts them inside the figure that matters: your basis is "the amount you spent to acquire the virtual currency, including fees, commissions and other acquisition costs in U.S. dollars". An export that lists a fee of 0.00012 BTC has told you the fact and not the number. See taker fee for why the rate itself is rarely one figure either.

Nothing in the file is denominated in money. This is the gap, and it is structural rather than anybody's oversight. The exchange recorded what happened on the exchange, in the assets of the exchange. What a tax return needs is a disposal with a basis and a proceeds figure in fiat — "your gain or loss will be the difference between your adjusted basis in the virtual currency and the amount you received in exchange for it, which you should report on your federal income tax return in U.S. dollars". For a coin you bought there with dollars, the file has enough. For a coin you deposited, it does not and cannot: the acquisition happened elsewhere, on a date this venue never saw, and the taxpayer is the one required to "maintain records that are sufficient to establish the positions taken on tax returns".

And the venue may not be there. An exchange that has stopped operating cannot re-issue a statement, and the one thing every list of supported venues in this catalogue agrees on is that venues disappear. Export while you still have an account, not when somebody asks.

If you outgrow this

If the problem is completeness, the answer is an export per venue per year, run on a schedule, stored somewhere that is not the exchange — plus the deposit and withdrawal records, which are the half people skip and the half that carries the missing basis.

If the problem is that this has to be a report, this catalogue is the wrong place to finish. One card here carries a tax-reporting capability and it is an export from a trading workspace, not a tax engine; calculating a gain is accounting software, which is outside what this site covers. Get complete, reconciled records out and hand them to something built for that.

If the problem is that you needed this for a counterparty rather than for yourself, the institutional tier is not an upgrade of the same product, it is a different one: the record is the point of the system rather than a feature of it, and it comes with a name on the support contract.

The tools named above

In the order this page puts them in, which is an editorial judgement and not a ranking anyone paid for.

  1. CCXT

    A read-only key and fetchMyTrades against 104 venues in one shape — check exchange.has, because supported is per method and not per exchange.

    One MIT client for 104 crypto exchanges, 76 of them over websocket.

    FreeFree tierOpen source

  2. Altrady

    Imports an exchange account to backfill a journal and exports trades, balances and a tax file — on the top tier only, 90 days at a time.

    Multi-exchange trading workspace — smart orders, scanners, bots and a journal.

    €10/moFree tier

  3. Coinigy

    One of the oldest multi-exchange workspaces, with CSV and an API, if the venue you traded on is still on its list.

    One of the oldest multi-exchange workspaces — 38 venues charted, 13 of them traded.

    $18.66/moFree tier

  4. Talos

    The institutional shape of the same job — the export is an API and a settlement ledger rather than a download, behind KYC and a sales call.

    Institutional crypto OEMS — aggregated liquidity, execution algos, one-click settlement.

    KYC

FAQ

How far back can I export?

Further than most people expect and in smaller pieces than they want. Binance serves up to six months immediately, capped at 10,000 data points per export; anything older is a generated statement covering at most one year from the date you pick, back to 13 July 2017, and you may only generate five statements a month. The download link is kept for seven days. A five-year history is a scheduled task, not an afternoon.

Does a trade history file contain my cost basis?

No, and this is the gap that costs people weeks. The file records what happened on that exchange in the assets of that exchange. Your basis is what you spent to acquire the asset in fiat, including fees — which for anything you deposited was established somewhere else entirely, on a date the exchange has no record of. A perfect export from every venue still leaves every transferred-in coin without a basis.

Is a ledger export the same as a trade export?

Not quite, and you usually need both. Kraken's ledger rows carry txid, time in UTC, a type spanning trade, margin, earn, deposit, withdrawal and transfer, plus asset, amount as a debit or credit, fee and the resulting balance — so one trade appears as legs in two assets rather than as one row. The trade file tells you what you did; the ledger tells you what moved, including the fees and the transfers the trade file never mentions.

Does this catalogue list tax software?

No. One card carries a tax-reporting capability, and it is an export from a trading workspace rather than a tax engine. Calculating a gain is accounting rather than market software, which puts it outside what this site covers — so the honest end of this page is getting complete, reconcilable records out, and handing them to something built for the next part.

Sources

  1. How to Download Spot Trading Transaction History Statement Binance, read
  2. How to export ledgers and trades history — ledger field definitions Kraken, read
  3. Frequently asked questions on virtual currency transactions Internal Revenue Service,

The catalogue next door

This page names a handful of products. The rest of them are in Crypto Trading Terminals, each filled in against the same schema, with the fields to narrow it yourself.

Last updated . Corrected in place — an endpoint that moves is a bug on this page, not a new post.