Skip to content

Instantly share code, notes, and snippets.

@multidis
Created February 28, 2024 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save multidis/24c131f27139570dd1ce75d18c523496 to your computer and use it in GitHub Desktop.
Save multidis/24c131f27139570dd1ce75d18c523496 to your computer and use it in GitHub Desktop.
Coinbase Pro fills statement export does not work as of Feb 2024 (just in time for tax prep!). Infinite wheel on the front-end, 500 status response from the API. Old Pro API still works and allows exporting fills to compute taxable transactions.
## Problem
## https://www.reddit.com/r/CoinBase/comments/18b1oqe/comment/krtzg2n/
## As a workaround, use old API (as of 2024-02)
## https://github.com/danpaquin/coinbasepro-python
## (Python 3.7) pip install cbpro
import json
import cbpro
# supply API credentials
auth_client = cbpro.AuthenticatedClient(key, secret, passphrase)
# modify product_id as needed
fills_gen = auth_client.get_fills(product_id="BTC-USD")
all_fills = list(fills_gen)
with open("fills.json", 'w') as outfile:
json.dump(all_fills, outfile)
## use fills.json to compute taxable transactions etc. Import into pandas if easier.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment