深交所公告订阅推送服务,支持按公司、类别订阅上市公司公告,并通过邮件/钉钉/飞书实时推送结构化提取结果
深交所公告订阅推送服务,支持按公司、类别订阅上市公司公告,并通过邮件/钉钉/飞书实时推送结构化提取结果。
Base URL: http://39.104.68.74:8452
API Key: mk_6b06aedefda608f513dd02599ff04c56
当前订阅配额: 免费版(最多 3 个类别订阅)
curl "http://39.104.68.74:8452/api/v1/subscriptions?page=1&page_size=20" \
-H "X-API-Key: mk_6b06aedefda608f513dd02599ff04c56"
curl "http://39.104.68.74:8452/api/v1/subscriptions/available-categories" \
-H "X-API-Key: mk_6b06aedefda608f513dd02599ff04c56"
curl -X POST "http://39.104.68.74:8452/api/v1/subscriptions" \
-H "X-API-Key: mk_6b06aedefda608f513dd02599ff04c56" \
-H "Content-Type: application/json" \
-d '{
"sub_type": "category",
"notify_method": "email",
"notify_target": "[email protected]",
"category_code": "人事变动",
"category_name": "人事变动"
}'
curl -X DELETE "http://39.104.68.74:8452/api/v1/subscriptions/{subscription_id}" \
-H "X-API-Key: mk_6b06aedefda608f513dd02599ff04c56"
| 类型 | 说明 | 配额消耗 |
|---|---|---|
company | 订阅某公司所有已开放类别 | 1 |
category | 订阅所有公司的某类别 | 1 |
company_category | 精准订阅某公司某类别 | 1 |
daily_digest | 每日聚合推送 | 不消耗配额 |
| 方式 | 说明 | 参数格式 |
|---|---|---|
email | 邮件推送 | 邮箱地址 |
dingtalk | 钉钉机器人 | Webhook URL |
feishu | 飞书机器人 | Webhook URL |
订阅所有公司的"董事会决议"公告,推送到飞书:
curl -X POST "http://39.104.68.74:8452/api/v1/subscriptions" \
-H "X-API-Key: mk_6b06aedefda608f513dd02599ff04c56" \
-H "Content-Type: application/json" \
-d '{
"sub_type": "category",
"notify_method": "feishu",
"notify_target": "https://open.feishu.cn/open-apis/bot/v2/hook/YOUR_WEBHOOK_URL",
"category_code": "ctb_company_0081",
"category_name": "董事会决议"
}'
订阅"平安银行"的所有公告,推送到邮件:
curl -X POST "http://39.104.68.74:8452/api/v1/subscriptions" \
-H "X-API-Key: mk_6b06aedefda608f513dd02599ff04c56" \
-H "Content-Type: application/json" \
-d '{
"sub_type": "company",
"notify_method": "email",
"notify_target": "[email protected]",
"company_code": "000001",
"company_name": "平安银行"
}'
每天早上 9:00 收取昨日公告汇总:
curl -X POST "http://39.104.68.74:8452/api/v1/subscriptions" \
-H "X-API-Key: mk_6b06aedefda608f513dd02599ff04c56" \
-H "Content-Type: application/json" \
-d '{
"sub_type": "daily_digest",
"notify_method": "email",
"notify_target": "[email protected]",
"digest_time": "09:00"
}'
curl "http://39.104.68.74:8452/api/v1/subscriptions/available-companies?keyword=平安&page=1&page_size=20" \
-H "X-API-Key: mk_6b06aedefda608f513dd02599ff04c56"
当前支持以下 14 个类别:
| 类别代码 | 类别名称 | 准确率 |
|---|---|---|
| 人事变动 | 人事变动 | 97.73% |
| 业绩预告 | 业绩预告 | 98.66% |
| O_临时公告_股票交易异常波动 | 股票交易异常波动 | 100% |
| O_临时公告_变更证券简称 | 变更证券简称 | 100% |
| O_临时公告_召开业绩说明会 | 召开业绩说明会 | 97% |
| 核心技术人员离职 | 核心技术人员离职 | 100% |
| 业务资格获批 | 业务资格获批 | 100% |
| O_临时公告_用募集资金置换预先投入的自筹资金 | 用募集资金置换预先投入的自筹资金 | 95.3% |
| O_临时公告_变更会计师事务所 | 变更会计师事务所 | 100% |
| O_临时公告_中标候选人公示 | 中标候选人公示 | 96.88% |
| O_临时公告_取消重大资产重组并复牌 | 取消重大资产重组并复牌 | 100% |
| O_临时公告_重大资产重组终止 | 重大资产重组终止 | 95% |
| O_临时公告_应当披露交易的提示 | 应当披露交易的提示 | 98.03% |
| O_临时公告_股票交易风险提示 | 股票交易风险提示 | 97.29% |
| ID | 订阅类型 | 类别 | 通知方式 | 目标 | 状态 |
|---|---|---|---|---|---|
| 8 | 每日聚合 | 人事变动 | 邮件 | [email protected] | ✅ |
| 7 | 类别订阅 | 股票交易风险提示 | 钉钉 | (webhook) | ✅ |
| 6 | 类别订阅 | 股票交易异常波动 | 飞书 | (webhook) | ✅ |
| 4 | 类别订阅 | 人事变动 | 飞书 | (webhook) | ✅ |
| 3 | 类别订阅 | 人事变动 | 钉钉 | (webhook) | ✅ |
| 2 | 类别订阅 | 人事变动 | 邮件 | [email protected] | ✅ |
{
"code": 200,
"message": "查询成功",
"data": {
"total": 6,
"page": 1,
"page_size": 20,
"items": [...]
}
}
{
"detail": "关键词订阅配额已用完 (5/3),当前等级: free"
}
⚠️ 重要提示:
💡 最佳实践:
daily_digest 汇总推送,避免过于频繁的通知创建 Python 包装脚本,方便通过自然语言调用:
#!/usr/bin/env python3
# scripts/announcement_subscription.py
import requests
import json
import sys
API_BASE = "http://39.104.68.74:8452"
API_KEY = "mk_6b06aedefda608f513dd02599ff04c56"
def get_headers():
return {"X-API-Key": API_KEY, "Content-Type": "application/json"}
def list_subscriptions():
"""查看所有订阅"""
response = requests.get(
f"{API_BASE}/api/v1/subscriptions?page=1&page_size=20",
headers=get_headers()
)
return response.json()
def create_subscription(sub_type, notify_method, notify_target, category_code=None, category_name=None, company_code=None, company_name=None, digest_time=None):
"""创建订阅"""
data = {
"sub_type": sub_type,
"notify_method": notify_method,
"notify_target": notify_target
}
if category_code:
data["category_code"] = category_code
data["category_name"] = category_name
if company_code:
data["company_code"] = company_code
data["company_name"] = company_name
if digest_time:
data["digest_time"] = digest_time
response = requests.post(
f"{API_BASE}/api/v1/subscriptions",
headers=get_headers(),
json=data
)
return response.json()
def delete_subscription(subscription_id):
"""删除订阅"""
response = requests.delete(
f"{API_BASE}/api/v1/subscriptions/{subscription_id}",
headers=get_headers()
)
return response.json()
def get_available_categories():
"""获取可订阅类别"""
response = requests.get(
f"{API_BASE}/api/v1/subscriptions/available-categories",
headers=get_headers()
)
return response.json()
def get_available_companies(keyword=None, page=1, page_size=20):
"""获取可订阅公司"""
params = {"page": page, "page_size": page_size}
if keyword:
params["keyword"] = keyword
response = requests.get(
f"{API_BASE}/api/v1/subscriptions/available-companies",
headers=get_headers(),
params=params
)
return response.json()
if __name__ == "__main__":
# 示例:查看订阅列表
result = list_subscriptions()
print(json.dumps(result, indent=2, ensure_ascii=False))
用户可以直接说:
飞书机器人:
钉钉机器人:
问题: detail: "关键词订阅配额已用完 (5/3),当前等级: free"
解决方案:
daily_digest 汇总推送(不消耗配额)问题: 删除订阅后仍提示配额已用完
可能原因: 软删除机制,配额未立即释放
解决方案:
问题: 更新订阅时 notify_method 字段无变化
解决方案: