Market data in your terminal, shaped for humans, scripts, and agents.
Search instruments, resolve quote IDs, inspect live quotes, review history, export datasets, and read indicator-rich observation output from one consistent command tree.
Installation · 30-second start · Command map · Output model · Indicator coverage · Observation examples
|
Discoverable A task-shaped command tree makes it easier to find the right entrypoint than browsing raw upstream functions. |
Readable The CLI keeps terminal output consistent across table, json, csv, and tsv, with observation as the default view.
|
Indicator-rich Compatible commands can be enriched with a broad built-in technical-indicator set for screening, review, and downstream analysis. |
Install the published PyPI package the-efinance-cli. The package exposes both efinance and efi.
uv
uv add -U the-efinance-cli
efinance --help |
pip
pip install -U the-efinance-cli
efinance --help |
Python 3.10+ is required.
efinance-cliis a product layer on top ofefinance, not a loose script collection.
It reorganizes upstream capability into a public command tree that is easier to browse from a terminal, easier to automate from scripts, and easier to consume in structured output. The goal is not to replace the upstream market-data library. The goal is to make that capability more stable and more usable from a CLI.
1. Search first
efinance search --query AAPL --market US_stock --result-count 5 --format json |
2. Resolve quote_id
efinance resolve quote-id --symbol AAPL --market us_stock --format json105.AAPL.
|
3. Query market data
efinance stock price history --symbols AAPL --market us_stock --start-date 20250102 --end-date 20250501 --format json |
Instrument discovery
|
Cross-asset data access
|
Structured output
|
Indicator enrichment
|
| Top-level command | Role | Typical use |
|---|---|---|
search |
Keyword-based discovery. | Find candidates before you know the exact identifier. |
resolve |
Identifier resolution. | Turn a symbol into a reusable quote_id. |
quote |
Cross-asset quote access. | Use when the quote_id is already known. |
market |
Market-level queries. | Run live scans and market-mapping style lookups. |
stock |
Stock-oriented queries. | History, snapshots, live lists, flows, holders, and profiles. |
fund |
Fund-oriented queries. | NAV history, live estimates, allocation, managers, and reports. |
bond |
Bond-oriented queries. | Profiles, price history, live lists, trades, and flows. |
futures |
Futures-oriented queries. | Catalog, history, live quotes, and trade detail. |
watch |
Refresh wrapper. | Repeat a supported subcommand on a shared polling loop. |
Current real defaults
|
Practical notes
|
| Output or runtime flag | Purpose |
|---|---|
--format table|json|csv|tsv |
Choose terminal view or export-friendly structured output. |
--full |
Print more complete result content. |
--transpose |
Transpose tabular output for easier terminal reading in some cases. |
--no-index |
Hide row indices in table output. |
--limit N |
Keep only the first N rows in the rendered result. |
--output PATH |
Write the rendered result to a file. |
--encoding utf-8 |
Set file-output encoding. |
--watch --interval --count --clear/--no-clear |
Run supported commands on a refresh loop. |
efinance-cli ships with a broad built-in indicator set. Compatible commands can expose far more than raw quotes, which makes the CLI useful for screening, review, and downstream analytics.
Moving averages and base transforms
sma · ema · rma · wma · dema · tema · trima · hma · zlema · highest · lowest · median_price · typical_price · true_range
Trend and channel indicators
macd · bollinger_bands · donchian_channel · keltner_channel · moving_average_envelope · aroon_indicator · dmi · adx · supertrend · parabolic_sar · ichimoku_cloud
Momentum indicators
momentum · roc · rsi · stochastic_oscillator · kdj · cci · williams_r · trix · tsi · ultimate_oscillator · dpo · ppo
Volume and money-flow indicators
obv · accumulation_distribution · chaikin_money_flow · chaikin_oscillator · mfi · vwap · force_index · ease_of_movement · price_volume_trend · volume_ratio
Volatility indicators
atr · natr · historical_volatility · chaikin_volatility · mass_index
Price-structure indicators
pivot_points · fibonacci_retracement · rolling_support_resistance
Common Chinese-market technical indicators
bias · bbi · psy · vr · mtm · dma · brar · cr · emv · asi
| Level | What it gives you in practice |
|---|---|
basic |
The core trend and momentum set such as MA, EMA, MACD, RSI, KDJ, BOLL, ATR, and OBV. |
advanced |
Broader trend-strength, channel, and money-flow coverage such as ADX, Donchian, Keltner, SuperTrend, MFI, PVT, CMF, VWAP, VR, and PSY. |
full |
Richer structure and market-context layers such as Ichimoku, SAR, Mass Index, Pivot Points, Fibonacci Retracement, support/resistance, ADL, Chaikin Oscillator, Chaikin Volatility, and EMV. |
The examples below only show the public-facing observation format.
Latest quote observation
Command
efinance quote price latest --quote-ids 105.AAPL --format table --indicator-level full --trace-window 4Typical output
+-----------------------------+
| meta |
+-----------------------------+
| module: common |
| function: get_quote_history |
| view: observation |
| indicator_level: full |
| trace_window: 4 |
| row_count: 4 |
| code: AAPL |
| name: Apple Inc. |
| as_of: 2026-05-28 |
+-----------------------------+
+------------------+
| latest_quote |
+------------------+
| code: AAPL |
| name: Apple Inc. |
| date: 2026-05-28 |
| close: 106 |
| open: 105 |
| high: 107 |
| low: 104 |
| volume: 1700 |
+------------------+
+---------------------+
| current_metrics |
+---------------------+
| close: 106 |
| open: 105 |
| high: 107 |
| low: 104 |
| volume: 1700 |
| ma5: 103 |
| ma10: 102.5 |
| macd_dif: 0.36 |
| macd_dea: 0.26 |
| rsi14: 59 |
+---------------------+
+-----------------------------------+
| trace_points.price_ma |
+-----------------------------------+
| [block 1] bar_offset: -3 -> 0 |
| bar_offset: -3 | -2 | -1 | 0 |
| close: 100 | 102 | 104 | 106 |
| ma5: 99.8 | 100.5 | 102 | 103 |
| ma10: 100.1 | 100.4 | 101 | 102.5 |
+-----------------------------------+
+-------------------------------------------------------------+
| recent_events |
+-------------------------------------------------------------+
| [1] bars_ago: -2 |
| event_key: ma5_crossed_above_ma10 |
| subject_a: ma5 |
| relation: crossed_above |
| subject_b: ma10 |
| description: ma5 moved from below to above ma10 |
| prev_a: 99.8 prev_b: 100.1 curr_a: 100.5 curr_b: |
| 100.4 |
+-------------------------------------------------------------+
History observation
Command
efinance stock price history --symbols AAPL --market us_stock --start-date 20250102 --end-date 20250501 --format table --indicator-level advanced --trace-window 4Typical output
+-----------------------------+
| meta |
+-----------------------------+
| module: common |
| function: get_quote_history |
| view: observation |
| indicator_level: full |
| trace_window: 4 |
| row_count: 4 |
| code: AAPL |
| name: Apple Inc. |
| as_of: 2026-05-28 |
+-----------------------------+
+---------------------+
| current_metrics |
+---------------------+
| close: 106 |
| ma5: 103 |
| ma10: 102.5 |
| ma20: 101.4 |
| ema12: 102.9 |
| ema26: 101.7 |
| macd_dif: 0.36 |
| macd_dea: 0.26 |
| rsi14: 59 |
| kdj_k: 62 |
| kdj_d: 60 |
| plus_di: 28 |
| minus_di: 16 |
| adx: 28 |
+---------------------+
+---------------------------------------+
| trace_points.macd_osc |
+---------------------------------------+
| [block 1] bar_offset: -3 -> 0 |
| bar_offset: -3 | -2 | -1 | 0 |
| macd_dif: 0.05 | 0.2 | 0.28 | 0.36 |
| macd_dea: -0.02 | 0.08 | 0.18 | 0.26 |
| rsi14: 51 | 54 | 56 | 59 |
| kdj_k: 50 | 55 | 60 | 62 |
| kdj_d: 47 | 52 | 57 | 60 |
+---------------------------------------+
+-------------------------------------------------------------+
| recent_events |
+-------------------------------------------------------------+
| [1] bars_ago: 0 |
| event_key: volume_ratio_5_crossed_above_1 |
| subject_a: volume_ratio_5 |
| relation: crossed_above |
| subject_b: 1.0 |
| description: volume_ratio_5 moved from at-or-below to |
| above 1 |
| prev_a: 1 prev_b: 1 curr_a: 1.3 curr_b: 1 |
+-------------------------------------------------------------+
Multi-source fund observation
Command
efinance fund nav history-batch --symbols 161725 --symbols 005827 --format table --view observation --trace-window 4Typical output
+---------------+
| source.161725 |
+---------------+
+-----------------------------+
| meta |
+-----------------------------+
| module: common |
| function: get_quote_history |
| view: observation |
| indicator_level: full |
| trace_window: 4 |
| row_count: 4 |
| code: AAPL |
| name: Apple Inc. |
| as_of: 2026-05-28 |
+-----------------------------+
+------------------+
| latest_quote |
+------------------+
| code: AAPL |
| name: Apple Inc. |
| date: 2026-05-28 |
| close: 106 |
+------------------+
+---------------+
| source.005827 |
+---------------+
+-----------------------------+
| meta |
+-----------------------------+
| module: common |
| function: get_quote_history |
| view: observation |
| indicator_level: full |
| trace_window: 4 |
| row_count: 4 |
| code: AAPL |
| name: Apple Inc. |
| as_of: 2026-05-28 |
+-----------------------------+
+------------------+
| latest_quote |
+------------------+
| code: AAPL |
| name: Apple Inc. |
| date: 2026-05-28 |
| close: 106 |
+------------------+
Search and inspect
efinance search --query NVDA --market US_stock
efinance resolve quote-id --symbol NVDA --market us_stock
efinance quote price latest --quote-ids 105.NVDA |
Watch a quote
efinance watch --interval 5 --count 3 quote price latest --quote-ids 105.AAPL --format json |
Batch fund history
efinance fund nav history-batch --symbols 161725 --symbols 005827 --format json |
Market-level live scan
efinance market price live --market m:105+t:3 --format json |
Data-source boundaries
|
Usage boundaries
|
See LICENSE.