← Back to Skills Marketplace
noahstepheno

A股上市公司公告

by Stepeno · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
446
Downloads
1
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install cn-stock-announcements
Description
A tool to query Chinese listed company announcements from SZSE (Shenzhen Stock Exchange) and SSE (Shanghai Stock Exchange). Supports single/batch stock queri...
README (SKILL.md)

Chinese Stock Announcements (SZSE & SSE)

这个技能用于查询中国A股上市公司(上交所、深交所)的官方信息披露与公告。它可以作为独立脚本供人类或大模型使用,也可以作为 OpenClaw 插件直接集成在 Python 代码中。

使用场景

  • 用户需要查询某只特定股票(如平安银行 000001、浦发银行 600000)的最新公告时。
  • 用户想批量追踪多只股票的动向时。
  • 用户想通过关键词(如"年报"、"重组"、"分红")来搜索两市所有相关的公告时。
  • 用户需要限定特定的时间范围(精确到时分秒)来过滤公告时。

工作流程

当用户请求查询股票公告时,大模型应该直接调用本项目提供的 stock_plugin.py 脚本来获取数据,并格式化输出给用户。

方式一:命令行/脚本直接调用 (CLI)

你可以直接执行 Python 代码来调用该模块:

# 例子:查询包含关键词且在指定时间内的公告
python3 -c "
import json
from stock_plugin import StockAnnouncementPlugin
plugin = StockAnnouncementPlugin()
res = plugin.query_announcements(
    keyword='年报',
    start_date='2024-03-15 00:00:01',
    end_date='2024-03-16 00:00:01',
    limit=5
)
print(json.dumps(res, indent=2, ensure_ascii=False))
"

方式二:在 OpenClaw 工作流中调用 (Python 代码编写)

如果用户要求你编写一段使用该功能的 OpenClaw 代码,你可以按照以下方式组织代码:

from openclaw2 import OpenClaw
from stock_plugin import StockAnnouncementPlugin

# 初始化 OpenClaw 客户端
client = OpenClaw.remote(api_key="your_api_key")

# 安装股票公告查询插件
client.use(StockAnnouncementPlugin())

# 让大模型 Agent 调用插件获取数据
results = client.pipeline([
    "请帮我查询 000001 和 600000 从 2024-03-15 00:00:01 到 2024-03-16 00:00:01 发布关于「年报」的公告"
])

print(results[-1])

参数说明

StockAnnouncementPlugin.query_announcements 支持以下参数:

参数 类型 说明 示例
stock_codes List[str] 股票代码列表(可选) ["000001", "600000"]
keyword str 搜索关键词(可选) "年报"
start_date str 起始时间(精确到秒或天) "2024-03-15 00:00:01""2024-03-15"
end_date str 结束时间(精确到秒或天) "2024-03-16 00:00:01""2024-03-16"
limit int 单个交易所返回的最大结果数 10 (默认)

⚠️ 时间过滤规则注意:

  1. 深交所 (SZSE):原生 API 请求体支持传入日期(YYYY-MM-DD)获取粗略范围,随后通过脚本在本地自动进行精确到时分秒的二次过滤筛选。
  2. 上交所 (SSE):原生 API 仅支持日期级别(YYYY-MM-DD)的检索和返回,所以插件会自动截取传入时间的日期部分进行检索。上交所数据由于没有时分秒属性,不支持秒级精确过滤。

技能资源

  • stock_plugin.py:核心逻辑文件,包含 StockAnnouncementPlugin 类及沪深两市的抓取和过滤逻辑。使用标准 requests 库实现,无需复杂环境。

前置条件

需要安装 requests 库:

pip install requests
Usage Guidance
This skill appears coherent and focused on fetching exchange announcements. Before installing, consider: 1) Network access: the plugin makes outbound requests to SZSE and SSE endpoints (note SZSE/SSE URLs used in the code and that some requests are plain HTTP), so ensure your environment permits these calls and that you trust those endpoints. 2) Rate limits and scraping policies: exchanges may throttle or block automated queries—use reasonable limits and caching. 3) No credentials are requested by the skill, so avoid supplying unrelated API keys or secrets to it. 4) If you require HTTPS-only traffic, review/modify the code to use secure endpoints where available. 5) As with any third-party code, review and run in a sandboxed environment if you have stricter security requirements.
Capability Analysis
Type: OpenClaw Skill Name: cn-stock-announcements Version: 1.0.1 The skill is a legitimate tool for querying Chinese stock announcements from the Shenzhen (SZSE) and Shanghai (SSE) stock exchanges. The implementation in `stock_plugin.py` uses standard HTTP requests to official exchange API endpoints and contains no evidence of data exfiltration, malicious execution, or prompt injection.
Capability Assessment
Purpose & Capability
The name/description match the provided Python implementation: the plugin queries SZSE and SSE announcement endpoints, supports stock lists, keywords, and date ranges. Required files (stock_plugin.py, requirements.txt) and the API usage align with the described functionality.
Instruction Scope
SKILL.md instructs the agent to call stock_plugin.py or integrate via OpenClaw; it does not instruct reading unrelated system files, environment variables, or exfiltrating data. Example code includes an OpenClaw API key parameter, but that is a generic example for client usage and not a requirement of the skill.
Install Mechanism
No install-time downloads or extract steps are declared (instruction-only). A requirements.txt lists requests and openclaw, which is proportionate. There are no third-party URLs or archive downloads in the install process.
Credentials
The skill declares no required environment variables or credentials. The code performs only outbound HTTP(S) requests to official exchange endpoints and does not attempt to read secrets or local config.
Persistence & Privilege
always is false and the plugin registers itself only with a client-provided register_tool method (no forced global installation or modification of other skills). It does not persist or modify other agent/system configurations.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cn-stock-announcements
  3. After installation, invoke the skill by name or use /cn-stock-announcements
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Removed README.md file from the project. - No changes to functionality or usage.
v1.0.0
Initial release of cn-stock-announcements. - Query official company announcements for SZSE and SSE-listed Chinese stocks. - Supports single or batch stock code queries, keyword searches, and precise time-range filtering. - CLI and OpenClaw workflow usage are both documented. - Allows filtering by keywords (e.g., "annual report") and by time down to the second for SZSE; SSE supports date-only filtering. - Requires only the requests library; no complex dependencies.
Metadata
Slug cn-stock-announcements
Version 1.0.1
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is A股上市公司公告?

A tool to query Chinese listed company announcements from SZSE (Shenzhen Stock Exchange) and SSE (Shanghai Stock Exchange). Supports single/batch stock queri... It is an AI Agent Skill for Claude Code / OpenClaw, with 446 downloads so far.

How do I install A股上市公司公告?

Run "/install cn-stock-announcements" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is A股上市公司公告 free?

Yes, A股上市公司公告 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does A股上市公司公告 support?

A股上市公司公告 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created A股上市公司公告?

It is built and maintained by Stepeno (@noahstepheno); the current version is v1.0.1.

💬 Comments