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+
  • pipx — installs the CLI in an isolated environment
  • 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

The CLI accepts daily and monthly archive partitions. Availability depends on the market and dataset; for example, futures funding rates use monthly archives. Kline types require --interval (such as 1m), independently of partition frequency. Use list-files to discover what Binance publishes for a selection. See archive paths and the glossary.

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 local ZIP files against sibling SHA256 checksums; no network access

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

Downloads count individual objects, including ZIP and checksum files. Successful transfer or an up-to-date local copy does not establish SHA256 verification. Verification counts ZIPs and distinguishes newly verified files from those skipped using cached verification. See command outcomes for counts, cleanup, and exit semantics.

Architecture

CLI Layer        Thin Typer commands (argument parsing, output formatting)
    │
Workflow Layer   Business logic (diff computation, verification protocol)
    │
Archive Layer    Remote listings and downloads, local directories, checksums, markers
    │
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

Agent development

Contributors using agents need the Matt Pocock skills collection recorded in skills-lock.json, including writing-for-agents for Markdown and domain-modeling for terminology and architectural decisions. These are development tools; using the Python package or CLI does not require them. The packaged binance-datatool skill separately teaches CLI usage.

For a fresh checkout, install uv for Python development and Node.js/npm for the skills installer, then run from the repository root:

uv sync
npx skills experimental_install --agent codex claude-code --frozen-lockfile

Select the agent names you use. The installer restores the recorded collection into .agents/skills/ and links agent-specific directories as needed. Its --dry-run option previews restoration without installing. Read AGENTS.md before working; CLAUDE.md imports that same guide.

The tracked skill record contains source repositories, skill paths, and content hashes. It does not pin an upstream commit or guarantee reproducible restoration. Frozen installation fails if fetched content would change the record. If upstream content has moved or changed, leave updates to the maintainer: manually review the upstream changes, run the installer's explicit update command when approved, and review the resulting skill-record diff. Skills are not updated automatically by package setup or CI. Installer options are documented in npx skills --help.

For Python and testing conventions, read coding standards.

Metadata

Release files for binance-datatool 0.2.0

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.2.0
File Size Uploaded Provenance Actions
binance_datatool-0.2.0.tar.gz 456.2 kB With provenance Details for binance_datatool-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 502.8 kB

Release files / binance_datatool-0.2.0.tar.gz

Download URL binance_datatool-0.2.0.tar.gz
Size 456.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ef162982425be138787152a1c007e7dd8ef10d640f4195b35e3dc39d24dd5ad7
BLAKE2b-256 checksum
How to use checksums
4d306906a0ba697d5df5c2b799c8a66a13ff88ddf797bb7f9ac302b0b51272fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

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

Download URL binance_datatool-0.2.0-py3-none-any.whl
Size 46.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58a1250ab112ec03ea7e1a0b65376eaae7286bbea7062bf47929de9fa5ca95a5
BLAKE2b-256 checksum
How to use checksums
6679b126794e96049543e5f79525d9f098636eb8b02f92541d7d0bc7eab7da72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for binance-datatool 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for binance_datatool-0.2.0.tar.gz

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 Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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