Data Query
Retrieve market data from the mist stock analysis backend.
Available Scripts
list_indices
List all available securities (stocks, indices, funds).
python scripts/list_indices.py
Returns: Array of {id, symbol, name, type} objects.
get_index_info
Get details for a specific security by code.
python scripts/get_index_info.py --code 000001.SH
Parameters:
--code(required): Security code, e.g.000001.SH,399006.SZ
get_kline_data
Query intraday K-line data. If stored data is missing, this script can initialize the security, attach a data source, trigger Mist collection, and retry the query.
python scripts/get_kline_data.py --code 600519.SH --name "贵州茅台" --period 60min --start-date "2026-06-26 09:30:00" --end-date "2026-06-26 15:00:00"
Parameters:
--code(required): Security code--period(required): One of1min,5min,15min,30min,60min(converted to Mist numeric period values before request)--start-date(required): Start date (YYYY-MM-DD or YYYY-MM-DD HH:MM:SS)--end-date(required): End date (YYYY-MM-DD or YYYY-MM-DD HH:MM:SS)--source(optional): Data source —ef(East Money),tdx(TongDaXin),mqmt(MaQiMaTe). Defaults toMIST_DEFAULT_SOURCEortdx--name(optional): Security display name used when the security must be initialized--no-auto-collect(optional): Only query stored data; do not initialize or collect
get_daily_kline
Query daily K-line data. If stored data is missing, this script can initialize the security, attach a data source, trigger Mist collection, and retry the query.
python scripts/get_daily_kline.py --code 600519.SH --name "贵州茅台" --start-date "2026-06-21" --end-date "2026-06-28"
Parameters:
--code(required): Security code--start-date(required): Start date--end-date(required): End date--source(optional): Data source, defaults toMIST_DEFAULT_SOURCEortdx--name(optional): Security display name used when the security must be initialized--no-auto-collect(optional): Only query stored data; do not initialize or collect
Usage Pattern
- Run
list_indicesfirst to discover available securities - Use
get_index_infoto verify a specific symbol - Query K-line data with
get_kline_data(intraday/minute/hour) orget_daily_kline(daily) - For a daily query like "贵州茅台最近一周日线", call
get_daily_klinedirectly with--code 600519.SH --name "贵州茅台"; do not call the security API manually, because Mist usesPOST /v1/securities,POST /v1/security-sources, andPOST /v1/collector/collectinternally.
AstrBot Intent Examples
- "有哪些股票可以查" → run
list_indices - "贵州茅台最近一周日线" → run
get_daily_kline --code 600519.SH --name 贵州茅台 - "贵州茅台今天 60 分钟 K 线" → run
get_kline_data --code 600519.SH --name 贵州茅台 --period 60min
Defaults and guardrails:
- Default source is
tdxunless the user requests another source. - Prefer
dailywhen the user does not specify a period. - Ask for a code or infer one confidently before calling scripts.
- Reject unbounded multi-symbol history requests and ask the user to narrow the scope.
Response Fields
K-line data returns: id, symbol, time, amount, open, close, high, low.
Mist API Notes
The current Mist backend expects numeric period enum values. Use the aliases above in Skill calls; scripts convert them automatically.