Skip to main content

Binance DataTool - Built for Agents, Data Delivered.

PyPI Python 3.11+ License: BSD-3-Clause Ruff uv

A non-official Python toolkit for managing historical market data from data.binance.vision — designed from the ground up for AI agents and quantitative workflows.

binance-datatool is designed to make every command equally easy to call for AI agents and humans.:

  • Composable CLI — stdin/stdout pipelines let agents chain commands without glue code
  • Atomic operations — each command does one thing well; agents can inspect, decide, and act step by step
  • Deterministic output — structured, parseable results that agents can reason about
  • Zero interaction — no prompts, no confirmations; dry-run mode for safe previews

Agent Skill

A packaged Agent Skill is included in this repository.

It teaches agents how to use binance-datatool to discover, download, and verify Binance historical market data — no manual command lookup required.

Features

  • Multi-market coverage — Spot, USD-M Futures, and COIN-M Futures
  • Smart symbol filtering — filter by quote asset, exclude stablecoins and leveraged tokens, select contract types
  • Resumable batch downloads — diff-based sync via aria2 that only fetches new or updated files
  • Data integrity verification — SHA256 checksum validation with timestamped marker caching
  • Composable pipelines — Unix-friendly design; commands read from stdin and write to stdout
  • Async I/O — concurrent S3 listing and parallel checksum verification

Quick Start

Prerequisites

  • Python 3.11+
  • uv — fast Python package manager
  • aria2 — required for the download command

Install

# install the CLI
pipx install binance-datatool
# run `pipx ensurepath` if the command isn't found immediately

# system dependency for download command
# macOS
brew install aria2
# Ubuntu/Debian
sudo apt install aria2

export BINANCE_DATATOOL_ARCHIVE_HOME="$HOME/crypto_data/binance_archive"

binance-datatool --help

Try it

# List USDT-quoted spot symbols, excluding stablecoins
binance-datatool list-symbols spot --quote USDT --exclude-stables

# Download daily 1m klines
binance-datatool list-symbols spot --quote USDT --exclude-stables \
  | binance-datatool download spot --type klines --interval 1m

# Verify integrity
binance-datatool verify spot --type klines --interval 1m BTCUSDT

Supported Data Types

Category Types
Trade data klines, aggTrades, trades
Derivatives fundingRate, liquidationSnapshot, metrics
Order book bookDepth, bookTicker
Index data indexPriceKlines, markPriceKlines, premiumIndexKlines

Each type is available in daily or monthly partitions. Kline types support all standard intervals (1m 3m 5m 15m 30m 1h 2h 4h 6h 8h 12h 1d 3d 1w 1mo).

CLI Overview

The entry point is binance-datatool. All data commands are available directly on the root app:

Command Description
list-symbols List available symbols on the remote archive
list-files List archive files for given symbols
download Download new or updated archive files
verify Verify files against SHA256 checksums

[!TIP] Every command accepts symbols from stdin or as positional args, making it trivial to compose pipelines:

binance-datatool list-symbols um --quote USDT \
  | binance-datatool download um --type klines --interval 1m

Run binance-datatool --help for the full option reference.

Architecture

CLI Layer        Thin Typer commands (argument parsing, output formatting)
    │
Workflow Layer   Business logic (diff computation, verification protocol)
    │
Archive Layer    S3 communication (HTTP listing, aria2 downloading, checksums)
    │
Common Layer     Shared types, enums, constants, and utilities

See docs/architecture.md for a detailed design overview.

Documentation

Document Description
Architecture Layered design, data flow, and key decisions
Module Reference Per-subpackage API reference
Extending How to add commands, enums, workflows, and tests
Testing Guide Test organization and conventions
Agent Skill Packaged skill for agents

Metadata

Release files for binance-datatool 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for binance-datatool 0.1.1
File Size Uploaded
binance_datatool-0.1.1.tar.gz 402.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for binance-datatool 0.1.1
File Interpreter ABI Platform
binance_datatool-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 444.0 kB

Release files / binance_datatool-0.1.1.tar.gz

Download URL binance_datatool-0.1.1.tar.gz
Size 402.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3ed1d39f096b072b84d7010b9850d1eb3b741301d059591c460c50151cd657fc
BLAKE2b-256 checksum
How to use checksums
dd9f7a0ee6f553a7486d0343e9536c9698a4db163b40cf16f1160b9538c1082d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.

Transparency log

Release files / binance_datatool-0.1.1-py3-none-any.whl

Download URL binance_datatool-0.1.1-py3-none-any.whl
Size 41.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cafc2c3dcc49a6023da6b69a9160edef6ba909704e886b05d6d461fc94a996b1
BLAKE2b-256 checksum
How to use checksums
6143f686afccf1072e523c0d1fa19597e5f90afb9ee99e3307ff40bc22979ddc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page