<< All versions

Skill v1.0.0

currentLLM-judged scan90/100
szwzz/astockpursue/tencent
──Details
PublishedOctober 21, 2026 at 08:31 PM
Content Hashsha256:35bd08e19ba5ddaf...
Git SHA497af47bdd71
──Files
Files (1 file, 3.1 KB)
SKILL.md3.1 KBactive
SKILL.md · 88 lines · 3.1 KB

version: "1.0.0" name: tencent description: Tencent Finance real-time quotes and K-line data for A-shares and HK stocks. Free, no API key, millisecond-level real-time data. #4 fallback in the A-share chain (after mootdx/eastmoney, before baidu/futu/twelvedata/akshare). category: data-source


Tencent Finance

Overview

Tencent Finance provides free, real-time stock quotes and historical K-line data for China A-shares (Shanghai/Shenzhen) and Hong Kong stocks. No registration or API key required.

  • Real-time quotes: qt.gtimg.cn — millisecond-level price updates
  • K-line data: web.ifzq.gtimg.cn/appstock/app/fqkline/get — daily/weekly/monthly

The project has a built-in Tencent DataLoader (backtest/loaders/tencent.py). When backtesting, set source: "tencent" or rely on source: "auto" (Tencent is the #4 fallback for A-shares after mootdx/tushare/eastmoney, #3 for HK stocks after yfinance/Futu).

Quick Start

The DataLoader handles code normalization automatically. No separate setup needed.

python
from backtest.loaders.tencent import DataLoader, normalize_cn_code, normalize_hk_code
loader = DataLoader()
# Fetch historical K-lines
data = loader.fetch(
codes=["000001.SZ", "600519.SH"],
start_date="2025-01-01",
end_date="2025-12-31",
interval="1D",
)
# Fetch real-time quote
quote = loader.fetch_quote("000001.SZ")
# Returns: {symbol, name, last, change, change_percent, open, high, low,
# previous_close, volume, amount, turnover, pe, market_cap}

Code Format

MarketProject FormatTencent FormatExample
A-share (Shanghai)600519.SHsh600519贵州茅台
A-share (Shenzhen)000001.SZsz000001平安银行
A-share (Beijing)430047.BJbj430047
HK stock700.HKhk00700腾讯控股

Real-time Quote Fields

The quote endpoint returns ~50 fields. Key fields:

IndexFieldDescription
1nameStock name (GBK-decoded)
2symbolExchange-tagged code
3lastCurrent price
4prev_closePrevious close
5openToday's open
6volumeVolume (手)
33highToday's high
34lowToday's low
37amountTurnover (万元)
38turnover_rateTurnover rate (%)
39peP/E ratio
45market_capTotal market cap (亿元)

K-line Adjustment Modes

ModeParamDescription
qfq前复权Forward-adjusted (default in AStockPursue)
hfq后复权Backward-adjusted
(none)不复权Unadjusted

Limitations

  • No minute-level K-lines: Tencent fqkline supports day/week/month only. Use AKShare for minute bars.
  • GBK encoding: Responses are GBK-encoded. The DataLoader handles this automatically.
  • No US stocks: Tencent only covers CN/HK markets.

Fallback Position

In the auto-routing chain, Tencent is positioned as a fast, free fallback:

  • A-shares: tushare → tencent → twelvedata → akshare
  • HK stocks: yfinance → futu → tencent → twelvedata → akshare
All versions