← 返回 Skills 市场
hacksing

allstock-data

作者 AIWareTop · GitHub ↗ · v1.0.2
cross-platform ⚠ suspicious
1686
总下载
0
收藏
19
当前安装
3
版本数
在 OpenClaw 中安装
/install allstock-data
功能描述
Stock market data query skill for China A-shares, Hong Kong, and US markets. Uses Tencent Finance HTTP API by default (lightweight, no install needed), with...
使用说明 (SKILL.md)

\r \r

Stock Data Query\r

\r Two data sources are supported. Tencent Finance HTTP API is used by default:\r \r

  1. Tencent Finance HTTP API (Default) — Lightweight, no installation, no proxy required\r
  2. adata SDK (Optional) — More comprehensive data, requires installation and possibly a proxy\r \r ---\r \r

1. Tencent Finance HTTP API (Default)\r

\r

1.1 China A-Share Real-Time Quotes\r

\r Endpoint:\r

http://qt.gtimg.cn/q=\x3Cstock_code>\r
```\r
\r
**Stock Code Format:**\r
\r
| Market | Code Prefix | Example |\r
|--------|-------------|---------|\r
| Shanghai Main Board | sh600xxx | sh600519 (Moutai) |\r
| STAR Market | sh688xxx | sh688111 |\r
| Shenzhen Main Board | sz000xxx | sz000001 (Ping An Bank) |\r
| ChiNext (GEM) | sz300xxx | sz300033 |\r
| ETF | sz159xxx | sz159919 |\r
\r
**Index Codes:**\r
\r
| Index | Code |\r
|-------|------|\r
| SSE Composite (Shanghai) | sh000001 |\r
| SZSE Component (Shenzhen) | sz399001 |\r
| ChiNext Index | sz399006 |\r
| STAR 50 | sz399987 |\r
| CSI 300 | sh000300 |\r
\r
**Examples:**\r
```bash\r
# Single stock\r
curl -s "http://qt.gtimg.cn/q=sh600519"\r
\r
# Multiple stocks\r
curl -s "http://qt.gtimg.cn/q=sh600519,sh000001,sz399001"\r
```\r
\r
**Response Fields:**\r
```\r
v_sh600519="1~贵州茅台~600519~1460.00~1466.21~1466.99~14146~6374~7772~..."\r
          ~  Name    ~ Code  ~  Open  ~  High  ~   Low  ~ Volume\r
```\r
\r
| Index | Field |\r
|-------|-------|\r
| 0 | Market code |\r
| 1 | Stock name |\r
| 2 | Stock code |\r
| 3 | Current price |\r
| 4 | Open price |\r
| 5 | Low price |\r
| 6 | High price |\r
| 30 | Price change |\r
| 31 | Change % |\r
\r
---\r
\r
### 1.2 Hong Kong Stock Real-Time Quotes\r
\r
**Endpoint:**\r
```\r
http://qt.gtimg.cn/q=hk\x3Cstock_code>\r
```\r
\r
**Examples:**\r
```bash\r
# Tencent Holdings\r
curl -s "http://qt.gtimg.cn/q=hk00700"\r
\r
# Alibaba\r
curl -s "http://qt.gtimg.cn/q=hk09988"\r
```\r
\r
---\r
\r
### 1.3 US Stock Real-Time Quotes\r
\r
**Endpoint:**\r
```\r
http://qt.gtimg.cn/q=us\x3Cticker>\r
```\r
\r
**Examples:**\r
```bash\r
# Apple\r
curl -s "http://qt.gtimg.cn/q=usAAPL"\r
\r
# Tesla\r
curl -s "http://qt.gtimg.cn/q=usTSLA"\r
\r
# NVIDIA\r
curl -s "http://qt.gtimg.cn/q=usNVDA"\r
```\r
\r
---\r
\r
### 1.4 K-Line Historical Data\r
\r
**Endpoint:**\r
```\r
https://web.ifzq.gtimg.cn/appstock/app/fqkline/get\r
```\r
\r
**Parameters:**\r
| Parameter | Description |\r
|-----------|-------------|\r
| `_var` | Variable name, e.g. `kline_dayqfq` |\r
| `param` | stock_code, kline_type, start_date, end_date, count, adjust_type |\r
\r
**K-Line Types:** `day` / `week` / `month`\r
\r
**Adjustment Types:** `qfqa` (forward-adjusted) / `qfq` (backward-adjusted) / empty (unadjusted)\r
\r
**Examples:**\r
```bash\r
# Moutai daily K-line (last 10 days, forward-adjusted)\r
curl -s "https://web.ifzq.gtimg.cn/appstock/app/fqkline/get?_var=kline_dayqfq&param=sh600519,day,,,10,qfqa"\r
\r
# Ping An Bank weekly K-line (last 5 weeks)\r
curl -s "https://web.ifzq.gtimg.cn/appstock/app/fqkline/get?_var=kline_weekqfq&param=sz000001,week,,,5,qfqa"\r
\r
# ChiNext Index monthly K-line (last 3 months)\r
curl -s "https://web.ifzq.gtimg.cn/appstock/app/fqkline/get?_var=kline_monthqfq&param=sz399006,month,,,3,qfqa"\r
```\r
\r
**Response Format:**\r
```json\r
{"day": [["2026-02-27", "1466.99", "1461.19", "1476.21", "1456.01", "13534"], ...]}\r
                Date       Open      Close      High       Low      Volume\r
```\r
\r
---\r
\r
### 1.5 Order Book Analysis\r
\r
**Endpoint:**\r
```\r
http://qt.gtimg.cn/q=s_pk\x3Cstock_code>\r
```\r
\r
**Example:**\r
```bash\r
curl -s "http://qt.gtimg.cn/q=s_pksh600519"\r
```\r
\r
**Returns:** Buy/sell volume ratios (internal vs external trades)\r
\r
---\r
\r
## 2. adata SDK (Optional)\r
\r
adata is an open-source A-share quantitative data library providing more comprehensive data. Requires installation and possibly a proxy.\r
\r
### Installation\r
\r
```bash\r
pip install adata\r
```\r
\r
### Proxy Setup (if needed)\r
\r
```python\r
import adata\r
adata.proxy(is_proxy=True, ip='your-proxy-ip:port')\r
```\r
\r
### Feature List\r
\r
| Feature | Description |\r
|---------|-------------|\r
| Stock Basic Info | All A-share codes, share capital, SW industry classification |\r
| K-Line Data | Daily/Weekly/Monthly, forward/backward adjustment |\r
| Real-Time Quotes | Batch real-time pricing |\r
| Level-2 Order Book | Bid/ask depth data |\r
| Capital Flow | Individual stock capital flow analysis |\r
| Concept Sectors | Thematic sector data |\r
| Index Data | Major index quotes |\r
| ETF | ETF quotes |\r
\r
### Usage Examples\r
\r
```python\r
import adata\r
\r
# Get all A-share stock codes\r
df = adata.stock.info.all_code()\r
\r
# Get K-line data\r
df = adata.stock.market.get_market(\r
    stock_code='000001',\r
    k_type=1,           # 1=daily, 2=weekly, 3=monthly\r
    start_date='2024-01-01',\r
    adjust_type=1        # 0=unadjusted, 1=forward, 2=backward\r
)\r
\r
# Real-time quotes\r
df = adata.stock.market.list_market_current(\r
    code_list=['000001', '600519']\r
)\r
```\r
\r
---\r
\r
## 3. Use Case Guide\r
\r
| Scenario | Recommended Source |\r
|----------|--------------------|\r
| Quick single stock price check | Tencent Finance API |\r
| K-line historical data | Tencent Finance API |\r
| Batch quote queries | Tencent Finance API |\r
| Capital flow data | adata SDK |\r
| Full financial statements | adata SDK |\r
| Concept/sector analysis | adata SDK |\r
| Level-2 order book | Tencent Finance API or adata SDK |\r
\r
---\r
\r
## 4. Important Notes\r
\r
1. **Encoding**: Tencent Finance API returns GBK-encoded text — decode accordingly\r
2. **Change %**: Use the API's built-in field (index 31) — do not calculate manually\r
3. **Data Delay**: Real-time data may have up to 15-minute delay\r
4. **Request Rate**: Avoid high-frequency requests — use batch queries when possible\r
5. **Error Handling**: Invalid stock codes return `v_pv_none_match="1"`\r
安全使用建议
This skill appears coherent and limited to querying public Tencent Finance endpoints and optionally using the adata Python package. Before installing/using: (1) if you choose the optional adata package, verify its PyPI project page, maintainers, and version — installing arbitrary pip packages carries supply-chain risk; consider installing in a virtualenv or sandbox; (2) the Tencent endpoints return GBK-encoded text and have rate limits—decode responses and batch requests to avoid throttling; (3) no credentials are required, so do not provide secrets; (4) if you need guaranteed accuracy or latency for trading decisions, verify data delay/legal/licensing terms with the data provider. Overall this skill is internally consistent with its stated purpose.
功能分析
Type: OpenClaw Skill Name: allstock-data Version: 1.0.2 The `SKILL.md` file demonstrates the use of `curl` commands and `pip install` instructions, which, if executed by the AI agent with unsanitized user input, could lead to shell injection vulnerabilities. Specifically, user-controlled parameters like `stock_code` in `curl` commands or `ip` in `adata.proxy` could be exploited. While these capabilities are plausible for the skill's stated purpose of fetching stock data, the lack of explicit input sanitization guidance for the agent creates a significant risk of command injection or arbitrary network redirection, classifying it as suspicious rather than benign due to the potential for exploitation.
能力评估
Purpose & Capability
The name/description (stock data for A-shares, HK, US) matches the SKILL.md: it documents Tencent Finance HTTP endpoints for real-time quotes, K-line history, and order-book data, and an optional adata SDK for more features. No unrelated services or credentials are requested.
Instruction Scope
Runtime instructions are limited to making HTTP requests to documented Tencent endpoints (qt.gtimg.cn, web.ifzq.gtimg.cn) and showing how to use the adata SDK. There are no instructions to read local files, harvest environment variables, or exfiltrate data to unexpected endpoints. Notes about GBK decoding and request-rate caution are appropriate for the task.
Install Mechanism
This is instruction-only with no install spec. The SKILL.md suggests an optional 'pip install adata' for extra features. Installing a third-party PyPI package is expected for that functionality but carries normal supply-chain/network risk; the skill itself does not force installation.
Credentials
The skill declares no required environment variables, no credentials, and no config paths. The only optional runtime configuration is an adata proxy setting (user-supplied), which is proportional to using a network proxy for the SDK.
Persistence & Privilege
The skill does not request always-on inclusion or any elevated agent privileges; default autonomous invocation is allowed (platform default). There are no instructions to modify other skills or system-wide settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install allstock-data
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /allstock-data 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
- Expanded support to include Hong Kong and US equities via Tencent Finance HTTP API. - Added multiple query examples and detailed instructions for real-time quotes, K-line history, and order book analysis for China A-shares, Hong Kong, and US markets. - Introduced optional adata SDK integration for advanced data (e.g. capital flow, sector data, financial statements). - Enhanced use-case guidance and clarified when to use each data source. - Improved field mapping, parameter explanation, and practical usage notes for all endpoints. - Added tips for encoding, data delay, error handling, and request rates.
v1.0.1
- Updated all user-facing documentation and examples from Chinese to English for broader accessibility. - No changes to code or functionality; only documentation language improved. - Clarified examples, field meanings, and notes in English. - Preserved all previous technical details and usage instructions.
v1.0.0
- Initial release of allstock-data skill. - Enables querying real-time and historical A-share (China) and US stock data via the Tencent Finance API. - Supports fetching quotes for stocks, indices, and ETFs in Chinese and US markets, with code rules and example APIs provided. - Includes data parsing instructions, field meanings, and Python data extraction code sample. - Offers US stock alternatives via Yahoo Finance and Alpha Vantage for broader coverage. - Provides practical guidance on encoding, data fields, error handling, and request limits.
元数据
Slug allstock-data
版本 1.0.2
许可证
累计安装 20
当前安装数 19
历史版本数 3
常见问题

allstock-data 是什么?

Stock market data query skill for China A-shares, Hong Kong, and US markets. Uses Tencent Finance HTTP API by default (lightweight, no install needed), with... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1686 次。

如何安装 allstock-data?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install allstock-data」即可一键安装,无需额外配置。

allstock-data 是免费的吗?

是的,allstock-data 完全免费(开源免费),可自由下载、安装和使用。

allstock-data 支持哪些平台?

allstock-data 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 allstock-data?

由 AIWareTop(@hacksing)开发并维护,当前版本 v1.0.2。

💬 留言讨论