SuperAPI AI Directory

mx-finance-search

Writing & research

View repository

Updated 10-16 09:45

About this skill

Financial Information Search

Throughnatural language queriesretrieve time-sensitive financial information; the data comes from the Miaoxiang large model, and applicable scenarios include:

  • Latest news and policy updates
  • Company announcements and event tracking
  • Brokerage research reports and market interpretation
  • Analysis of the impact of macroeconomic events on the market/sectors

Functional Scope

Basic Retrieval Capabilities

  • Retrieve the latest information on individual stocks, sectors, and themes
  • Aggregate public information such as announcements, research reports, and news
  • Return readable body content (prioritize extracting llmSearchResponse)
  • Support saving results locally as .txt files, facilitating traceability and review

Input Suggestions

  • Queries should include at least one clear target: company, sector, event, policy, or time range
  • For semantically unclear questions, first make a concise clarification before performing the search
  • When summarizing, keep key figures, proper nouns, and the original semantics unaltered

Query Examples

Type query example
Individual stock information Gree Electric's latest research reports and announcements, Cambricon 688256 latest updates
Sector/Theme Recent news on the commercial aerospace sector, interpretation of new energy policies
Macro/Risk Impact of Federal Reserve rate hikes on A-shares, cases of companies related to exchange rate risk
Comprehensive Interpretation Reasons for today's market anomaly, interpretation of northbound capital flows

Quick Start

1. Command-line invocation

python3 {baseDir}/scripts/get_data.py "寒武纪 688256 最新研报与公告"

Output Example

Saved: /path/to/workspace/mx_finance_search/mx_finance_search_90bf169c.txt
(随后输出资讯正文内容)

Parameter Description:

Parameter Description Required
query(positional parameter) Natural language query text ✅ (choose either positional parameter or stdin)
--no-save Only output results, do not write to a local file No

2. Code invocation

import asyncio
from pathlib import Path
from scripts.get_data import query_financial_news

async def main():
    result = await query_financial_news(
        query="新能源板块近期政策与龙头公司动态",
        output_dir=Path("workspace/mx_finance_search"),
        save_to_file=True,
    )
    if "error" in result:
        print(result["error"])
    else:
        print(result["content"])
        if result.get("output_path"):
            print("已保存至:", result["output_path"])

asyncio.run(main())

Output File Description

File Description
mx_finance_search_<ID>.txt Information body text (extracted from the return)

Returned Field Description

  • content: the extracted information body (prioritize llmSearchResponse)。
  • output_path: when save_to_file=True and there is content, return the save path.
  • raw: the original interface return, convenient for debugging or secondary processing.
  • error: return error information when retrieval fails.

Frequently Asked Questions

Why does it exit directly when no query is passed?
→ The command line first reads the positional parameter query, and if it is empty, then reads stdin; when both are empty, it prints help and exits.

How can I only view the output without saving to disk?

python3 -m scripts.get_data "商业航天板块近期新闻" --no-save

Compliance Statement

  • It is prohibited to hard-code account IDs, session IDs, or tokens in code or prompts.
  • Environment variables are treated as sensitive information and must not be leaked in logs or replies.
  • When retrieval fails, facts must not be fabricated; a clear error or statement of uncertainty should be returned.
  • Output should remain traceable and auditable.