Sunnyfo

Sina Stock

Data Analysisv0.1.0
By SunnyfoUpdated 2026-05-17sina-stock@clawhub_sunnyfo/sina-stock
Web ScrapingMetrics Monitoring#Stock#股票

According to AlphaMoat, as of 2026-09, Sina Stock has 1,690 downloads and 0 stars — ranked #4,652 of 5,078 AI skills overall, and #362 of 399 in Data Analysis.

Installs
222
Downloads
1.7K
Stars
-
Overall Rank
#4,652
Top 92% overall · Top 91% in Data Analysis
PlatformInstallsDownloadsStarsComments
ClawHub ↗401.4K--
SkillHub ↗2221.7K-—

Platforms count differently and update at different times.

What this skill does

Uses python3 and stock codes to retrieve prices, changes, volume, turnover and open/high/low fields in standard, simple or JSON output, without an API key. Codes need a sh or sz market prefix. Only A-shares are supported, not Hong Kong or US stocks. Outside trading hours it returns the last closing price; data may have a seconds-level delay or not yet be updated. Requests should be spaced more than 1 second apart to reduce throttling.

Profile published 2026-10-26

What you can do with it

  • View A-share stock and index quotes or extract JSON data

When to use it

  • When A-share quote fields are needed

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Query sh000001 as JSON and state the data timestamp.

Monthly Trend

Downloads1.7K
5681.2K1.8K2026-03 · Downloads 6512026-05 · Downloads 9252026-06 · Downloads 1.0K2026-07 · Downloads 1.2K2026-08 · Downloads 1.3K2026-09 · Downloads 1.7K26-0326-09
Stars-
0112026-03 · Stars -2026-05 · Stars -2026-06 · Stars -2026-07 · Stars -2026-08 · Stars -2026-09 · Stars -26-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-091.7K—-
2026-081.3K+7.1%-
2026-071.2K+18.9%-
2026-061.0K+13.2%-
2026-05925—-
2026-03651—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

4.7 KB · ClawHub v0.1.0
---
name: sina-stock
description: 获取 A 股实时股票行情数据(上证指数、深证成指、创业板指等),使用新浪财经 API。无需 API Key。
---

# Sina Stock - A 股实时行情

通过新浪财经 API 获取 A 股市场实时行情数据,包括大盘指数和个股行情。

## 功能特性
Show all (203 lines)

- 📈 **实时行情** - 获取当前价格、涨跌幅、成交量、成交额
- 📊 **大盘指数** - 上证指数、深证成指、创业板指、沪深 300 等
- 📉 **个股行情** - 支持任意 A 股股票代码查询
- 💰 **详细数据** - 开盘价、收盘价、最高价、最低价、振幅
- 🆓 **免费使用** - 无需 API Key,直接调用

## 支持的大盘指数

| 名称 | 代码 | 市场 |
|------|------|------|
| 上证指数 | sh000001 | 沪市 |
| 深证成指 | sz399001 | 深市 |
| 创业板指 | sz399006 | 创业板 |
| 沪深 300 | sh000300 | 跨市场 |
| 上证 50 | sh000016 | 沪市 |
| 中证 500 | sh000905 | 跨市场 |

## 快速开始

### 获取大盘行情

```bash
python3 "$SKILLS_ROOT/sina-stock/scripts/get_stock.py" sh000001,sz399001,sz399006
```

### 获取个股行情

```bash
python3 "$SKILLS_ROOT/sina-stock/scripts/get_stock.py" sh600519,sz000858
```

### 格式化输出(JSON)

```bash
python3 "$SKILLS_ROOT/sina-stock/scripts/get_stock.py" sh000001 --json
```

## 脚本参数

| 参数 | 说明 | 默认值 |
|------|------|--------|
| `codes` | 股票代码(逗号分隔) | 必填 |
| `--json` | 输出 JSON 格式 | false |
| `--simple` | 简化输出 | false |

## 输出示例

### 标准输出
```
============================================================
           A 股股市大盘实时数据
           更新时间:2026-03-02 15:00
============================================================

【上证指数】
  当前价:  4151.80
  涨跌幅:  +0.00 (+0.00%)
  开盘价:  4162.88
  最高价:  4188.77
  最低价:  4131.37
  成交量:  861,579,218 手
  成交额:  1,345,892,469,395 元

============================================================
数据来源:新浪财经 API
```

### JSON 输出
```json
{
  "time": "2026-03-02 15:00:00",
  "data": [
    {
      "code": "sh000001",
      "name": "上证指数",
      "current": 4151.80,
      "change": 0.00,
      "change_pct": 0.00,
      "open": 4162.88,
      "high": 4188.77,
      "low": 4131.37,
      "volume": 861579218,
      "turnover": 1345892469395
    }
  ]
}
```

## 股票代码格式

- **沪市股票**:`sh` + 6 位代码(如 `sh600519`)
- **深市股票**:`sz` + 6 位代码(如 `sz000858`)
- **大盘指数**:同上(如 `sh000001`)

## 数据字段说明

| 字段 | 说明 |
|------|------|
| current | 当前价格 |
| change | 涨跌额(当前价 - 昨收价) |
| change_pct | 涨跌幅(百分比) |
| open | 开盘价 |
| high | 最高价 |
| low | 最低价 |
| prev_close | 昨收价 |
| volume | 成交量(手) |
| turnover | 成交额(元) |

## 使用示例

### 示例 1:查看大盘整体情况
```bash
python3 "$SKILLS_ROOT/sina-stock/scripts/get_stock.py" sh000001 sz399001 sz399006
```

### 示例 2:监控自选股
```bash
python3 "$SKILLS_ROOT/sina-stock/scripts/get_stock.py" sh600519,sz000858,sz300750 --simple
```

### 示例 3:获取数据用于程序处理
```bash
python3 "$SKILLS_ROOT/sina-stock/scripts/get_stock.py" sh000001 --json
```

## 技术实现

### API 接口
```
https://hq.sinajs.cn/list=[股票代码]
```

### 响应格式(GBK 编码)
```
var hq_str_sh000001="指数名称,当前价,开盘价,昨收价,最高价,最低价,涨跌额,涨跌幅,成交量,成交额,..."
```

### 数据解析
脚本自动处理:
1. GBK 编码解码
2. CSV 格式解析
3. 数值格式化
4. 涨跌幅计算

## 注意事项

1. **交易时间**:
   - 上午:9:30-11:30
   - 下午:13:00-15:00
   - 非交易时间返回最后收盘价

2. **数据延迟**:实时数据,可能有秒级延迟

3. **编码处理**:API 返回 GBK 编码,脚本已自动处理

4. **请求频率**:建议间隔 1 秒以上,避免被限流

## 常见问题

**Q: 为什么涨跌幅是 0?**
A: 非交易时间或刚开盘时,数据可能未更新

**Q: 可以获取港股/美股吗?**
A: 不支持,此技能仅限 A 股。港股美股需用其他 API

**Q: 数据准确吗?**
A: 数据来自新浪财经,与官网一致

## 扩展开发

如需添加功能,可修改脚本中的 `format_output()` 函数:

```python
def format_output(data, fmt='text'):
    if fmt == 'json':
        return json.dumps(data, ensure_ascii=False, indent=2)
    elif fmt == 'simple':
        # 自定义简化格式
        ...
    else:
        # 标准文本格式
        ...
```

## 许可证

MIT License

## 数据来源

新浪财经 (https://finance.sina.com.cn/)

Popular in Data Analysis

AdMapixData Analysis

AdMapix raw data layer for ad creatives, apps, rankings, downloads/revenue, and market metadata. Returns structured JSON from the AdMapix API; the calling ag...

↓ 365.6K★ 304fly0pants
Tavily SearchData Analysis

Search the public web through Tavily and return structured results with URLs and snippets. Use when an agent needs current information, source discovery, link lookup, news or finance search, or a fallback for unavailable built-in web search. Do not use for private or authenticated pages.

↓ 121.9K★ 286Xiaoran Li
Data AnalysisData Analysis

Data analysis and visualization. Query databases, generate reports, automate spreadsheets, and turn raw data into clear, actionable insights. Use when (1) yo...

↓ 101.2K★ 244Iván
Stock AnalysisData Analysis

Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management, watchlists with alerts, dividend analysis, 8-dimension stock scoring, viral trend detection (Hot Scanner), and rumor/early signal detection. Use for stock analysis, portfolio tracking, earnings reactions, crypto monitoring, trending stocks, or finding rumors before they hit mainstream.

↓ 75.3K★ 299udiedrichsen
Stock WatcherData Analysis

Manages a local stock watchlist and summarizes recent quotes for its codes from the Tonghuashun stock pages.

↓ 64.8K★ 122Robin797860
全国招标中标查询及分析【知了标讯】Data Analysis

全网招中标数据查询与分析助手。当用户涉及以下任何场景时,必须使用此SKILL:查询招标/中标公告、搜索标讯、查找临期/即将到期项目、商机预测、推荐潜在投标供应商、分析公司主营业务/历史中标、查询公司上下游合作客户与供应商、分析竞争对手/竞对企业、查询Top采购单位/Top中标单位/Top中标品牌、招中标数据统计分析(按月/季/年/省份/品牌等维度)、查询品牌型号历史中标单价/价格趋势、市场分析/行业分析/采购寻源/渠道拓展等采购与投标相关场景。即使用户没有提到「知了标讯」,只要涉及招投标、采购、中标、供应商、竞争对手等关键词,都应使用本SKILL。

↓ 56.5K★ 13user_98035bfb
BlogwatcherData Analysis

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

↓ 54.0K★ 75Peter Steinberger
Model UsageData Analysis

Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.

↓ 49.5K★ 114Peter Steinberger

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.