← Back to Skills Marketplace
1686
Downloads
0
Stars
19
Active Installs
3
Versions
Install in OpenClaw
/install allstock-data
Description
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...
README (SKILL.md)
\r \r
Stock Data Query\r
\r Two data sources are supported. Tencent Finance HTTP API is used by default:\r \r
- Tencent Finance HTTP API (Default) — Lightweight, no installation, no proxy required\r
- 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¶m=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¶m=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¶m=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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install allstock-data - After installation, invoke the skill by name or use
/allstock-data - Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Frequently Asked Questions
What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 1686 downloads so far.
How do I install allstock-data?
Run "/install allstock-data" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is allstock-data free?
Yes, allstock-data is completely free (open-source). You can download, install and use it at no cost.
Which platforms does allstock-data support?
allstock-data is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created allstock-data?
It is built and maintained by AIWareTop (@hacksing); the current version is v1.0.2.
More Skills