datayes-fund-data
0.0.1| 基金与 ETF 数据查询 skill。通过 Python 脚本访问 Datayes API,覆盖净值、收益、持仓、 折溢价、资金流、基金经理、基金公司等场景。 用户提到基金、ETF、LOF、净值、持仓、收益、折溢价、基金经理、规模、资金流时使用。
| 基金与 ETF 数据查询 skill。通过 Python 脚本访问 Datayes API,覆盖净值、收益、持仓、 折溢价、资金流、基金经理、基金公司等场景。 用户提到基金、ETF、LOF、净值、持仓、收益、折溢价、基金经理、规模、资金流时使用。
访问 https://r.datayes.com/auth/login 登录 Datayes 账号,并在 Datayes 控制台获取可撤销的 API token。
python3 scripts/datayes_api.pyDATAYES_TOKEN 读取Authorization: Bearer <token>httpUrl 会先校验主机名,只允许 Datayes 受信任域名,避免把 token 发送到非 Datayes 地址python3 scripts/datayes_api.py spec fund_return_interval
python3 scripts/datayes_api.py call search_mutual_data --param keyword=华夏上证50ETF --param size=3
python3 scripts/datayes_api.py call fund_return_interval --param fundCode=510050 --param type=INTERVALcmd:
set "DATAYES_TOKEN=你的token"
python3 scripts\datayes_api.py spec fund_return_intervalPowerShell:
$env:DATAYES_TOKEN = "你的token"
python3 scripts\datayes_api.py spec fund_return_interval永久设置:
setx DATAYES_TOKEN "你的token"setx 只对新开的终端生效。
search_mutual_data 找 fundCode、accountId、securityIdspec 查看目标接口的 httpMethod、httpUrl、parametersInputcall 发请求,脚本会按接口规格自动分配 query、body、path 参数--show-request| 场景 | nameEn | 常用参数 |
|---|---|---|
| 基金搜索 | search_mutual_data |
keyword, size |
| 基金基本信息 | fund_basic_info |
fundCode |
| 区间收益 | fund_return_interval |
fundCode, type=INTERVAL |
| 年度收益 | fund_return_yearly |
fundCode, type=YEARLY |
| 折溢价率 | fund_dprate_hk |
ticker, dateString, num |
| 持仓分析 | fund_holding_analysis |
fundCode, withExtra=true |
| ETF 资金流 | get_fund_etf_mf |
ticker, beginDate, endDate |
| 基金经理观点 | fund_manager_viewpoint |
personId |
| ETF 排行 | fund_market_ranking |
category, sortKey, pageSize, pageNum |
Content-Type: application/jsonsearch_mutual_data 会优先把更接近用户关键词的结果排在前面--compact