Based onuser querysearch for relevantfinancial 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 the environment variable
EASTMONEY_APIKEYwhether it exists:
If it does not exist, prompt the user on the East Money Skills page (https://marketing.dfcfs.com/views/finskillshub/indexuNdYscEA?appfenxiang=1)获取apikey并设置到环境变量。echo $EASTMONEY_APIKEY
⚠️ Security Considerations
- External requests: This Skill will send the user's query keyword (Keyword) to the East Money official API interface (
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 users query 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 "companies with natural hedging advantages in A-shares exchange rate risk", "impact of Fed 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 explanation |
|---|---|
title |
Information title, highly summarizing the core content |
secuList |
List of related securities, including code, name, type, etc. |
secuList[].secuCode |
Security code (such as 002475) |
secuList[].secuName |
Security name (such as Luxshare Precision) |
secuList[].secuType |
Security 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)