| Crates.io | market-data-downloader |
| lib.rs | market-data-downloader |
| version | 0.2.0 |
| created_at | 2025-09-07 13:31:48.278898+00 |
| updated_at | 2025-09-11 22:10:47.114242+00 |
| description | A small Rust CLI to download market data aggregates from Polygon.io (minute or daily), and save them as CSV or JSON. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1828131 |
| size | 132,272 |
A small Rust CLI to download market data aggregates from providers such as Polygon.io and Twelve Data. It supports downloading minute or daily aggregates for equities, indices, and more, and saving them as CSV or JSON.
Data providers:
Select provider with --provider polygon (default) or --provider twelvedata.
--apikey or set POLYGON_API_KEY.--apikey or set TWELVEDATA_API_KEY.git clone https://github.com/marceloneppel/market-data-downloader.git
cd market-data-downloader
cargo build
cargo build --release
The binary name is market-data-downloader.
Basic examples:
cargo run -- \
download \
--apikey YOUR_POLYGON_KEY \
--ticker AAPL \
--from 2024-01-01 \
--to 2024-01-03 \
--out aapl.csv
POLYGON_API_KEY=YOUR_POLYGON_KEY \
cargo run -- \
download \
-t I:NDX \
-f 2024-02-01 \
-T 2024-02-01 \
--format json
This will save output to output/I:NDX_2024-02-01_2024-02-01.json by default.
TWELVEDATA_API_KEY=YOUR_TWELVEDATA_KEY \
cargo run -- \
download \
-t AAPL \
-f 2025-01-02 \
-T 2025-01-02 \
--granularity day \
--format csv \
--provider twelvedata
cargo run -- download -t AAPL -f 2024-01-01 -T 2024-01-02 --granularity day --apikey YOUR_POLYGON_KEY
output/YYYY/MM:cargo run -- download -t I:NDX -f 2025-01-01 -T 2025-01-05 --split-by-day --apikey YOUR_POLYGON_KEY
cargo run -- download -t AAPL -f 2025-01-01 -T 2025-01-01 --no-header --max-decimals 4 --apikey YOUR_POLYGON_KEY
cargo run -- download -t AAPL -f 2025-01-01 -T 2025-01-07 -v --rate-limit-wait-secs 12 --apikey YOUR_POLYGON_KEY
Notes:
--out is not specified, files are written under the output/ directory with an auto-generated name, for example: output/AAPL_2024-01-01_2024-01-03.csv.--split-by-day is used (which currently supports CSV only).Run unit and integration tests:
cargo test
The CI configuration is available under .github/workflows/ci.yml.
This project is licensed under the terms of the LICENSE file in the repository.