妙想智能选股 Skill (mxselectstock)
Overview
This skill enables safe, up‑to‑date stock screening using the Meixiang (妙想) stock‑screening service. It supports custom filters on market, financial indicators, and sector/category constraints, returning a full data table (CSV) with Chinese column headers and a supplemental description file.
Prerequisites
- 1. Obtain an API key from the Meixiang Skills page.
- Export the key to the environment variable
MX_APIKEY:
export MX_APIKEY="your_api_key_here"
- 3. Ensure
curl is installed (standard on macOS).
Usage Steps
- 1. Formulate the query – translate the user’s natural‑language request into a JSON payload containing at least:
-
keyword – the screening condition (e.g., "今日涨幅2%的股票")
-
pageNo – page number (default 1)
-
pageSize – number of rows per page (max 100, adjust as needed)
- 2. Execute the POST request:
curl -X POST \
--location 'https://mkapi2.dfcfs.com/finskillshub/api/claw/stock-screen' \
--header 'Content-Type: application/json' \
--header "apikey:${MX_APIKEY}" \
--data '{"keyword":"<YOUR_KEYWORD>","pageNo":1,"pageSize":20}'
- 3. Parse the JSON response – important fields:
-
status /
message – overall request success.
-
data.code /
data.msg – business‑level status.
-
data.data.result.columns – column definitions.
-
data.data.result.dataList – rows of stock data.
-
responseConditionList – condition statistics.
- 4. Transform column titles – map each
key to its Chinese title from the columns array, then build a CSV where the header line uses the Chinese titles. - Save output (optional):
# Save raw JSON
curl ... > mx_select_stock_raw.json
# Save CSV
<script to convert> > mx_select_stock.csv
# Save column description
<script to extract> > mx_select_stock_columns.md
- 6. Present to the user – show a brief summary (total matches, key conditions) and attach the CSV/description files if the user requested them.
Example
User request: “筛选今日涨幅在 2% 以上的 A 股”。
Command:
CODEBLOCK3
Sample JSON excerpt (truncated):
CODEBLOCK4
Formatted reply to user:
- - 匹配股票数量:57 只(符合条件)
- 筛选条件:今日涨幅 ≥ 2%
- 示例数据:
|序号|代码|简称|市场|最新价 (元)|涨跌幅 (%)|
|---|---|---|---|---|---|
|1|603866|桃李面包|SH|12.34|2.13|
|2|300991|创益通|SZ|8.76|2.05| …
Saving Results (optional)
If the user wants the full CSV, run a conversion script (e.g., Python) that reads
dataList, maps each
key to its Chinese
title, writes rows, and stores the file
mx_select_stock.csv. Also generate
mx_select_stock_columns.md describing each column.
When Not to Use
Do not invoke this skill for non‑financial queries, for generic web searches, or when the user explicitly asks for opinion‑based advice without needing raw screening data.
References
- - Meixiang API documentation (internal).
- Column‑mapping table (see
columns description above).
妙想智能选股技能 (mxselectstock)
概述
本技能利用妙想选股服务实现安全、实时的股票筛选。支持对市场、财务指标和行业/板块约束的自定义筛选,返回包含中文列标题的完整数据表(CSV格式)及补充说明文件。
前置条件
- 1. 从妙想技能页面获取API密钥。
- 将密钥导出为环境变量 MX_APIKEY:
bash
export MX
APIKEY=yourapi
keyhere
- 3. 确保已安装 curl(macOS系统默认安装)。
使用步骤
- 1. 构建查询 – 将用户的自然语言请求转换为JSON负载,至少包含:
- keyword – 筛选条件(例如:今日涨幅2%的股票)
- pageNo – 页码(默认1)
- pageSize – 每页行数(最大100,可按需调整)
- 2. 执行POST请求:
bash
curl -X POST \
--location https://mkapi2.dfcfs.com/finskillshub/api/claw/stock-screen \
--header Content-Type: application/json \
--header apikey:${MX_APIKEY} \
--data {keyword:
,pageNo:1,pageSize:20}
- 3. 解析JSON响应 – 重要字段:
- status / message – 请求整体状态。
- data.code / data.msg – 业务级状态。
- data.data.result.columns – 列定义。
- data.data.result.dataList – 股票数据行。
- responseConditionList – 条件统计。
- 4. 转换列标题 – 将 columns 数组中的每个 key 映射为对应的中文 title,然后构建CSV,其中标题行使用中文标题。
- 保存输出(可选):
bash
# 保存原始JSON
curl ... > mxselectstock_raw.json
# 保存CSV
<转换脚本> > mxselectstock.csv
# 保存列描述
<提取脚本> > mxselectstock_columns.md
- 6. 呈现给用户 – 显示简要摘要(总匹配数、关键条件),如果用户要求,附上CSV/描述文件。
示例
用户请求: 筛选今日涨幅在 2% 以上的 A 股。
命令:
bash
curl -X POST --location https://mkapi2.dfcfs.com/finskillshub/api/claw/stock-screen \
--header Content-Type: application/json \
--header apikey:${MX_APIKEY} \
--data {keyword:今日涨幅2%的股票,pageNo:1,pageSize:20}
示例JSON片段(截断):
json
{status:0,message:ok,data:{code:100,msg:解析成功,data:{result:{total:57,columns:[{title:序号,key:SERIAL},{title:代码,key:SECURITYCODE},{title:简称,key:SECURITYSHORTNAME},{title:市场,key:MARKETSHORTNAME},{title:最新价 (元),key:NEWESTPRICE},{title:涨跌幅 (%),key:CHG}],dataList:[{SERIAL:1,SECURITYCODE:603866,SECURITYSHORTNAME:桃李面包,MARKETSHORTNAME:SH,NEWESTPRICE:12.34,CHG:2.13}, ...]}}}}
格式化回复给用户:
- - 匹配股票数量:57 只(符合条件)
- 筛选条件:今日涨幅 ≥ 2%
- 示例数据:
|序号|代码|简称|市场|最新价 (元)|涨跌幅 (%)|
|---|---|---|---|---|---|
|1|603866|桃李面包|SH|12.34|2.13|
|2|300991|创益通|SZ|8.76|2.05| …
保存结果(可选)
如果用户需要完整CSV,运行转换脚本(例如Python),读取 dataList,将每个 key 映射为对应的中文 title,写入行数据,并保存文件 mxselectstock.csv。同时生成 mxselectstock_columns.md 描述每个列。
不适用场景
对于非金融查询、通用网页搜索,或当用户明确要求基于观点的建议而不需要原始筛选数据时,请勿调用本技能。
参考
- - 妙想API文档(内部)。
- 列映射表(参见上述 columns 描述)。