Based onuser querysearch relatedfinancial information, obtain information related to the query (such as research reports, news, interpretations, etc.), and return readable text content, which can optionally be saved to the working directory.
Usage
- First check whether the environment variable
EASTMONEY_APIKEYexists:
If it does not exist, prompt the user on the Eastmoney Skills page (https://marketing.dfcfs.com/views/finskillshub/indexuNdYscEA?appfenxiang=1)获取apikey并设置到环境变量。echo $EASTMONEY_APIKEY
⚠️ Security Notes
- External requests: This Skill will send the user's query keywords (Keyword) to the official Eastmoney API (
mkapi2.dfcfs.com) for parsing and retrieval.- Data usage: The submitted data is used only for information search and does not contain personal privacy information.
- Credential protection: The API Key is used only through the environment variable
EASTMONEY_APIKEYon the server side or in a trusted runtime environment, and will not be exposed in plaintext on the front end.
- Use a POST request to call the interface:
curl -X POST --location 'https://mkapi2.dfcfs.com/finskillshub/api/claw/news-search' \ --header 'Content-Type: application/json' \ --header "apikey: $EASTMONEY_APIKEY" \ --data '{"query":"用户的查询内容"}'
Applicable scenarios
Use this skill when the user queries the following types of content:
- Individual stock information: such as "Gree Electric latest research report", "Kweichow Moutai institutional views"
- Sectors/themes: such as "recent news on the commercial aerospace sector", "interpretation of new energy policies"
- Macro/risk: such as "A-share companies with natural hedging advantages exchange rate risk", "impact of Federal Reserve rate hikes on A-shares"
- Comprehensive interpretation: such as "reasons for today's market anomaly", "interpretation of northbound capital flows"
Return description
| Field path | Brief definition |
|---|---|
title |
Information title, highly summarizing the core content |
secuList |
List of related securities, including code, name, type, etc. |
secuList[].secuCode |
Securities code (such as 002475) |
secuList[].secuName |
Securities name (such as Luxshare Precision) |
secuList[].secuType |
Securities type (such as stock / bond) |
trunk |
Core information body / structured data block, carrying specific business data |
Example
import os
import requests
api_key = os.getenv("EASTMONEY_APIKEY")
if not api_key:
raise ValueError("请先设置EASTMONEY_APIKEY环境变量")
url = "https://mkapi2.dfcfs.com/finskillshub/api/claw/news-search"
headers = {
"Content-Type": "application/json",
"apikey": api_key
}
data = {
"query": "立讯精密的资讯"
}
response = requests.post(url, headers=headers, json=data)
response.raise_for_status()
result = response.json()
print(result)