Xpersona
腾

腾讯财经行情接口

CLAWHUB · Unverified

腾讯财经实时行情接口,查询A股、港股、美股、期货、外汇、ETF的实时行情数据。触发关键词:查股价、查行情、查指数、腾讯接口、股票报价、实时行情 Skill: 腾讯财经行情接口 Owner: ezio-xiang Summary: 腾讯财经实时行情接口,查询A股、港股、美股、期货、外汇、ETF的实时行情数据。触发关键词:查股价、查行情、查指数、腾讯接口、股票报价、实时行情 Tags: china:1.0.0, finance:1.0.0, latest:1.0.0, quote:1.0.0, realtime:1.0.0, stock:1.0.0 Version history: v1.0.0 | 2026-03-27T06:12:16.700Z | auto Tencent Finance real-time stock market API initial release: - Provides real-time quotes for A-shares, Hong Kong stocks, US stocks, futures, forex, and ETFs vi

62
Rank
84
Safety
1.9k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.9K downloads reported by the source. Last updated 10/9/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s174rd2h70xskmw6a50eww4xxx83pmp3:tencent-finance
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-ezio-xiang-tencent-finance/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

7,524 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: tencent-finance
description: 腾讯财经实时行情接口,查询A股、港股、美股、期货、外汇、ETF的实时行情数据。触发关键词:查股价、查行情、查指数、腾讯接口、股票报价、实时行情
---

# 腾讯财经行情接口(Tencent Finance API)

## 接口信息

**Base URL:** `https://qt.gtimg.cn/q=代码`

**特点:**
- 毫秒级响应,无需注册,即插即用
- 支持 A股、港股、美股、期货、外汇、ETF
- 查询频率建议间隔 100ms 以上,避免封 IP

---

## 代码规则

### A 股

| 前缀 | 市场 | 示例 |
|------|------|------|
| `sh` | 上交所 | `sh000001`(上证指数)、`sh600519`(茅台) |
| `sz` | 深交所 | `sz399001`(深证成指)、`sz000858`(五粮液) |

### 港 股

| 前缀 | 市场 | 示例 |
|------|------|------|
| `hk` | 港交所 | `hkHSI`(恒生指数)、`hkHSTECH`(恒生科技) |
| `hk` | 港交所个股 | `hk00700`(腾讯)、`hk09988`(阿里) |

### 美 股(指数)

| 代码 | 名称 |
|------|------|
| `usNDX` | 纳斯达克 100 |
| `usSPX` | 标普 500 |
| `usDJI` | 道琼斯 |

### 大宗商品

| 代码 | 名称 |
|------|------|
| `hf_GC` | 黄金(COMEX) |
| `hf_CL` | WTI 原油 |
| `hf_SI` | 白银 |

### 外汇

| 代码 | 名称 |
|------|------|
| `fx_usr` | 美元/人民币(USD/CNY) |

---

## 数据字段说明

返回字段以 `~` 分隔,关键字段索引:

| 索引 | 含义 |
|------|------|
| `[3]` | 当前价格 |
| `[4]` | 昨收价格 |
| `[5]` | 今开价格 |
| `[31]` | 涨跌额 |
| `[32]` | 涨跌幅(%) |
| `[33]` | 最高价 |
| `[34]` | 最低价 |
| `[36]` | 成交量(手) |
| `[37]` | 成交额(万元) |
| `[38]` | 换手率(%) |
| `[39]` | 市盈率(PE) |
| `[43]` | 振幅(%) |
| `[44]` | 流通市值 |
| `[45]` | 总市值 |

---

## 使用方式

### 直接在脚本中调用

```python
import requests

def get_quote(code):
    url = f"https://qt.gtimg.cn/q={code}"
    resp = requests.get(url, timeout=10)
    data = resp.text
    # 解析 v_xxx="51~名称~代码~价格~..."
    parts = data.split('="')[1].strip().strip('";')
    fields = parts.split('~')
    return {
        "name": fields[1],
        "code": fields[2],
        "price": fields[3],
        "yesterday_close": fields[4],
        "open": fields[5],
        "change": fields[31],
        "change_pct": fields[32],
        "high": fields[33],
        "low": fields[34],
        "volume": fields[36],
        "turnover": fields[37],
        "turnover_rate": fields[38],
        "pe": fields[39],
        "amplitude": fields[43],
    }

# 示例
quote = get_quote("sh000001")
print(f"{quote['name']}: {quote['price']} ({quote['change_pct']}%)")
```

### 多只股票同时查询

```python
def get_quotes(codes):
    # codes: list,如 ["sh000001", "sz399001", "hkHSI"]
    url = "https://qt.gtimg.cn/q=" + ",".join(codes)
    resp = requests.get(url, timeout=10)
    results = []
    for line in resp.text.strip().split('\n'):
        if '="v_' in line:
            parts = line.split('="')[1].strip().strip('";')
            fields = parts.split('~')
            results.append({
                "name": fields[1],
                "code": fields[2],
                "price": fields[3],
                "change": fields[31],
                "change_pct": fields[32],
                "high": fields[33],
                "low": fields[34],
            })
    return results

# 同时查询多只
quotes = get_quotes(["sh000001", "sz399001", "hkHSI", "hkHSTECH", "sh560860"])
for q in quotes:
    print(f"{q['name']}: {q['price']} ({q['change_pct']}%)")
```

---

## 常用代码速查

### A 股指数

| 名称 | 代码 |
|------|------|
| 上证指数 | `sh000001` |
| 深证成指 | `sz399

_meta.json

{
  "ownerId": "kn76hsffedvb6zna0cx9nwejm983qchk",
  "slug": "tencent-finance",
  "version": "1.0.0",
  "publishedAt": 1774591936700
}

skill-card.md

## Description:

腾讯财经行情接口用于通过腾讯财经公开接口查询 A 股、港股、美股指数、期货、外汇和 ETF 的实时行情数据。

This skill is ready for commercial/non-commercial use.

## Publisher:

[ezio-xiang](https://clawhub.ai/user/ezio-xiang)

### License/Terms of Use:

MIT-0

## Use Case:

Developers, analysts, and agent builders use this skill to retrieve and format real-time market quote data for supported stock, index, commodity, forex, and ETF symbols. Outputs are suitable for interactive lookups or scheduled quote snapshots, but should be treated as informational rather than investment advice.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Ticker symbols or code lists are sent to Tencent's finance endpoint during quote retrieval.

Mitigation: Avoid including personal portfolio notes, trading strategy text, or other sensitive context in ticker arguments.

Risk: Returned market data may be incomplete, delayed, unavailable, or unsuitable as a basis for financial decisions.

Mitigation: Treat returned quotes as informational only and verify important data against authoritative market-data sources before acting on it.

Risk: High-frequency polling can trigger endpoint throttling or IP blocking.

Mitigation: Keep requests at least 100 ms apart or use a more conservative rate limit for automated and cron-based retrieval.

## Reference(s):

- [Tencent Finance quote endpoint](https://qt.gtimg.cn/q=)
- [ClawHub skill page](https://clawhub.ai/ezio-xiang/skills/tencent-finance)
- [Publisher profile](https://clawhub.ai/user/ezio-xiang)

## Skill Output:

**Output Type(s):** [Text, Markdown, Code, Shell commands, Guidance]

**Output Format:** [Markdown guidance with Python examples and command-line text output]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Queries Tencent's public finance endpoint and formats selected quote fields such as price, open, high, low, volume, turnover, PE, and percentage change.]

## Skill Version(s):

1.0.0 (source: ClawHub release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to 腾讯财经行情接口 and adjacent AI workflows.