Tools

Data sources

One get_market_data call reaches 28 sources. With source auto, each symbol is routed by its market and walks that market's fallback chain, with the sources least likely to block you first.

Fallback chains

MarketChain, in order
China A-sharestencent, eastmoney, baostock, akshare, tushare, local
US equitiesyahoo, stooq, sina, eastmoney, yfinance, tiingo, fmp, finnhub, alphavantage, longbridge, akshare, local
Hong Kongtencent, eastmoney, yahoo, futu, akshare, yfinance, tushare, longbridge, local
Indiayahoo, yfinance, india_broker, local
Koreapykrx, yahoo, yfinance, local
Canada, UK, Vietnam, Argentina, indicesyahoo, yfinance, local
Cryptookx, binance, ccxt, yfinance, local
China futuresakshare, local
Forex and metalsmt5, akshare, yfinance, local
Fundstushare, akshare, local
Macroakshare, tushare, local

These sources are used only when you name them: gildata (requires market quotes enabled), tickerall (hosted MT5 feed), and nobitex / wallex (Iranian Toman pairs). Set MARKET_DATA_ORDER_<MARKET>, for example MARKET_DATA_ORDER_US_EQUITY, to reorder a chain.

The base install includes Tencent's standard-library HTTP loader and AKShare. BaoStock is an optional token-free TCP source for daily A-share bars: install it with pip install --upgrade "vibe-trading-ai[ashare]", or use uv tool install --force --python 3.12 "vibe-trading-ai[ashare]" for a uv tool installation that previously used only the base package. Missing optional SDKs are skipped during automatic fallback.

For uv tool users, --force rebuilds the existing tool environment. Keep previously used extras when adding ashare, for example "vibe-trading-ai[ashare,deepseek]", and repeat any existing --with arguments to retain those additional dependencies.

The legacy mootdx loader is also explicit-only: it has been retired from automatic fallback and is not included in the base install or the ashare extra. Installing its SDK does not guarantee compatibility with the TDX server protocol. Prefer source: "auto" or an available alternative such as tencent or baostock when an Eastmoney-backed request is throttled. Startup preflight covers selected services, not every optional loader, and an installed SDK does not prove remote-service availability.

Symbol formats

MarketExamples
China A-shares600519.SH, 000001.SZ
Hong Kong0700.HK
USAAPL.US, SPY.US — the suffix is required
CryptoBTC-USDT (uppercase, hyphen)
Korea / India / UK / Canada005930.KS, RELIANCE.NS, VOD.L, SHOP.TO
Vietnam / ArgentinaVNM.VN, GGAL.BA
China futuresRB0 (main continuous), IF2412
Forex and metalsEURUSD, XAUUSD
Your own fileslocal: prefix — CSV, Parquet or DuckDB

A suffix names the exchange, not the currency. A London line must declare GBP or GBp, and a Hong Kong counter is priced by the currency its stock code belongs to.

Choosing a source

Ask in plain language ("use Longbridge to fetch QQQ.US") or set "source" in a backtest config. An explicit local: symbol never falls back to a network source.

Beyond prices

22 read-only data tools cover fund flow, dragon-tiger lists, northbound flow, margin trading, block trades, shareholder counts, lock-up expiries, sectors, research reports, news, SEC filings, financial statements, option chains, company profiles, market screening, symbol search, macro series, iwencai, 13F institutional holdings, ETF look-through, prediction markets and research papers.