market-data
A Rust lib to fetch & enhance historical time-series stock market data.
This library provides a stateless, async-first API to download historical stock data from various providers and enhance it with common technical indicators.
Features
- Async-first: Built on
tokioandreqwest. - Stateless Architecture: Reusable clients and immutable request objects.
- Multiple Publishers: Supports Finnhub, Alpha Vantage, Massive (formerly Polygon.io), Twelvedata, and Yahoo Finance.
- Technical Indicators: Built-in support for SMA, EMA, RSI, MACD, and Stochastic Oscillator.
Installation
Add this to your Cargo.toml:
[]
= "0.5"
= { = "1.0", = ["full"] }
Usage
Each publisher provides a set of methods to create request objects, which are then passed to the MarketClient.
use ;
async
Supported Publishers
Details on rate limits and historical data depth can be found in Publishers.md.
- Finnhub
- Alpha Vantage
- Massive (formerly Polygon.io)
- Twelvedata
- Yahoo Finance (Unofficial, no token required)
Supported Market Technical Indicators
- Simple Moving Average (SMA)
- Exponential Moving Averages (EMA)
- Relative Strength Index (RSI)
- Stochastic Oscillator
- Moving Average Convergence/Divergence (MACD)
For Development
To run the examples, export your API keys:
# etc...
Run an example:
Contributing
Contributions are welcome! If you'd like to add a new publisher or technical indicator, please raise a PR or create an issue.
License
Apache-2.0