# Export 24h liquidations to CSV (Python) Writes every liquidation of the last N hours that the API serves to a CSV file, following the API's cursor pages. Standard library + the `blockmetric` SDK only. Which venues are included depends on the API's data licence (`meta.sources` names them; single liquidations of a venue the API may not redistribute answer `source_restricted`). ## Run ```bash export BLOCKMETRIC_API_KEY=bm_live_... # create one on /account/api export BLOCKMETRIC_BASE_URL=https:///api/v1 # until the SDK ships with the production URL # until the SDK is on PyPI, use the copy in this repository: export PYTHONPATH=../../sdk/python # Windows PowerShell: $env:PYTHONPATH="..\..\sdk\python" python export_liquidations.py --hours 24 --out liquidations.csv python export_liquidations.py --hours 6 --coin BTC --venue hyperliquid # to stdout ``` Columns: `ts, venue, coin, side, price, qty, usd`, newest first, times ISO 8601 UTC, `usd` is the notional in USD, `side` is the side of the liquidated position. Notes - The look-back is capped by your plan's history (free key: 30 days; keyless public access: 24 hours). Exchange totals are what the venues report (they undercount). - Each page is one request (up to 1,000 rows); a busy day can take a few pages. The SDK waits and retries on `429`. - No key is stored by the script; it reads `BLOCKMETRIC_API_KEY` from the environment.