---
name: tencent-a-share-quote
description: Read Tencent Finance quote snapshots for explicitly requested A-share codes or market indices, with provider timestamps and per-symbol availability. Use for A股行情、指数快照、个股最新价、涨跌幅或批量行情读取; this read-only helper does not place trades or modify a portfolio.
---

# Tencent A-share Quote

From this skill directory, use the local Python client (Python 3.10+ and `requests`):

```bash
python3 scripts/tencent_quote.py 600519.SH 000858.SZ
python3 scripts/tencent_quote.py --preset a_index
python3 scripts/tencent_quote.py --json sh000001 sz399001
```

Use the current device's Python command (`py -3` on Windows if needed). The client calls only `https://qt.gtimg.cn/q=` with the requested public codes. No tokens, cookies, orders, account files, or background jobs are involved.

## Inputs and schema

- Prefer explicit `600519.SH`, `000858.SZ`, `sh600519`, or `sz000858`. A bare six-digit code beginning with 6 maps to Shanghai; 0/2/3 map to Shenzhen. Other bare prefixes are ambiguous and rejected. For example, use `sh000001` for the Shanghai index; bare `000001` means Shenzhen.
- The legacy `a_hot` preset is a fixed example list, not a current recommendation or a selection model. Use explicit requested codes or `a_index` for diagnostics.
- HK/US/futures/FX native-code passthrough is retained for compatibility, but those feeds can use different field/timestamp formats. Only interpret fields after verifying the actual response; do not assume A-share units or timezone apply there. Beijing exchange support is not claimed.
- JSON preserves the original array and quote fields and adds `status`. Prices, changes, highs/lows, source `trade_time`, normalized `code`, and original `input_code` remain available. Missing numeric values are `null`, never a substitute zero; NaN and Infinity are not emitted.
- `status`: `available`, `no_data`, `invalid_data`, or `invalid_timestamp`. `available` means the row passed the basic price/shape/time checks; it does not establish freshness, market opening, or execution suitability.

## Exit codes and evidence

- **0**: every requested row passed basic checks.
- **2**: invalid input, network/HTTP error, or unexpected execution failure; diagnostic goes to stderr.
- **3**: one or more rows are unavailable or malformed. JSON still contains one row per request, including valid rows from a partially successful batch.

Report provider and `trade_time`, and compare its date/time with the task's market/session context before describing a snapshot as current. A-share timestamps are interpreted in Asia/Shanghai. After hours and on nontrading days, the last reported quote can be old even when the request succeeds. This helper has no exchange calendar and does not itself classify a quote as fresh.

Do not treat provider failure as an empty market, a zero price, a valid selection result, or authorization to trade. Do not silently swap sources: name any fallback provider and its timestamp/field differences, using only an already configured authorized source. Volume and amount units may vary with the feed; verify them before quantitative use.

For portfolio decisions or trading-related requests, follow the applicable Stock OS workflow and its authorization boundaries; this helper supplies only a read-only observation. It never writes candidates, holdings, advice, orders, or research episodes.
