Rust library, CLI, and HTTP server for querying financial data.
Hosted API
Free hosted version at finance-query.com:
# Get a quote
# Real-time streaming
What's in This Repository
- Library (
finance-query) - Core logic - CLI (
finance-query-cli) - Command-line tool for market data, technical analysis, and backtesting - Server (
finance-query-server) - HTTP REST API and WebSocket server - Derive Macros (
finance-query-derive) - Procedural macros for Polars DataFrame integration
Quick Start
Library
Add to your Cargo.toml:
[]
= "2.3"
# Or with additional features
= { = "2.3", = ["dataframe", "indicators", "fred", "crypto", "rss", "risk"] }
Single symbol:
use Ticker;
async
Batch operations:
use ;
async
SEC EDGAR filings:
use edgar;
async
CLI
Install fq (the command-line tool):
# Linux/macOS
|
# Windows
# From source
Quick examples:
See finance-query-cli/README.md for full documentation.
Server
Run the server locally (requires Rust):
Or run both v1 and v2 with Docker Compose:
The v2 server provides REST endpoints at /v2/* and WebSocket streaming at /v2/stream.
Documentation
Package guides:
- CLI - Command-line tool with examples, installation, and features
- Server - REST API and WebSocket server setup and endpoints
- Derive Macros - Procedural macros for Polars DataFrame support
Full documentation at verdenroz.github.io/finance-query:
- Library Getting Started
- Ticker API - Single symbol operations
- Tickers API - Batch operations
- EDGAR API - SEC filings
- Finance Module - Market-wide data
- REST API Reference
- WebSocket API
- Contributing
API Documentation:
Legacy Python Version (v1)
The original Python implementation is available in the v1/ directory. It is no longer actively maintained but remains available for reference.
Contributing
We welcome contributions! See the Contributing Guide for setup instructions and development workflow.
Acknowledgements
This project relies on Yahoo Finance's publicly available data. We are grateful to Yahoo for providing this data.
Special thanks to yfinance, the popular Python library that inspired this project. Many of the API patterns and data structures are adapted from yfinance's excellent work.
License
MIT License - see LICENSE for details.