Query Capabilities
1. Recognizable Query Objects
- Stocks (A-shares, Hong Kong stocks, US stocks)
- Sectors, indices, shareholders
- Corporate issuers, bonds, non-listed companies
- Stock market, fund market, bond market
2. Returnable Data Categories
The structured data that can be queried mainly includes:
- Market Quotes(latest prices, price change performance, order book details, etc.)
- Trading and Quantitative Indicators(technical statistics, capital flows, etc.)
- Financial and Statement Indicators(revenue, profit, financial ratios, etc.)
3. Combined Queries andUsage Limits
A query can include multiple entities, indicators, and time ranges at the same time.Due to server-side capability constraints, a single request must comply with the following quotas:
- Number of entities: A single request can contain at most 5 stocks or other financial entities.
- Over-limit handling: When the entities in a request exceed the limit, only the first 5 in order are processed, and the truncation is recorded in the description file.
Example: "Query the revenue of six stocks A, B, C, D, E, and F" -> only the first five are returned.
4. Result Files
After each successful execution, the following files are generated:
- A file that stores the structured data
xlsxworkbook - A file that records the query content, result meaning, and necessary notes
txtdescription file
Query Examples
Basic Indicator Queries
- East Money's main profitability indicators for the past three years
- Wuliangye's operating revenue and net profit for the most recent year
- The staged performance of the New Energy Vehicle ETF
Real-time Quotes and Order Book Queries
- The current real-time buy orders for 300750
- Microsoft's current latest price and price change percentage
- The CSI 500's current level and turnover
Multi-entity, Multi-indicator, Multi-time Queries (Note the Quota)
- Within-limit example: Compare the year-to-date gains (1 indicator) of the SSE 50, CSI 300, and CSI 1000 (3 entities).
- Within-limit example: CATL and BYD (2 entities)'s revenue, gross profit, and net profit (3 indicators) for the most recent year.
- Over-limit scenario: When querying "the PE of the top ten weighted stocks in the Shanghai and Shenzhen markets," the system only processes the top 5.
Query Boundaries
- This Skill is used to obtain structured financial data and relational data, and does not undertake subjective judgment, investment advice, or news interpretation.
- Query statements must specify clear financial entities.
- Natural language requests are parsed into query objects, indicators, and time ranges, and organized into structured result files.
- For requests within the scope of capabilities, structured data is generated first, accompanied by a result description file for subsequent processing.
3. Install dependencies
pip3 install httpx pandas openpyxl --user
Quick start
Run in the working directory
python3 {baseDir}/scripts/get_data.py --query "宁德时代最近一个月的涨跌幅"
Example output
xlsx: /path/to/miaoxiang/mx_finance_data/mx_finance_data_9535fe18.xlsx
描述: /path/to/miaoxiang/mx_finance_data/mx_finance_data_9535fe18_description.txt
行数: 42
Output file description
| File | Description |
|---|---|
mx_finance_data_<查询id>.xlsx |
Structured data table containing the requested entities and metrics |
mx_finance_data_<查询id>_description.txt |
Contains an explanation of the query logic, field meanings, andquota truncation notice |