接入文件
介面簡介
本介面用於查詢指定基金程式碼的歷史淨值資料。開發者可透過傳入基金程式碼及時間週期引數,獲取對應時間段內的單位淨值、累計淨值、淨值日期及日漲幅等關鍵金融指標,適用於金融資料分析與展示場景。
適用場景
- 金融APP開發:在移動端展示基金產品的歷史走勢與詳細淨值記錄。
- 投研資料分析:構建量化分析模型,需要批次獲取基金歷史表現資料。
- 財富管理門戶:為高淨值客戶提供透明的基金業績回溯與對比功能。
- 自動化報表生成:定期抓取特定基金的階段性淨值變化,生成投資週報或月報。
請求與返回說明
請求方式:POST 核心引數:
fundCode(必填):基金程式碼,字串型別。period(選填):查詢週期,取值1-8分別代表近1個月、3個月、6個月、1年、3年、5年、今年以來及成立以來。
返回結果: 成功響應包含 data.list 陣列,每項包含:
date:淨值日期netValue:單位淨值totalValue:累計淨值dayOfGrowth:日漲幅fundCode:基金程式碼
接入建議
- 引數校驗:請確保傳入的
fundCode格式正確,避免因程式碼錯誤導致查詢失敗。 - 週期選擇:根據業務需求合理選擇
period引數,避免頻繁請求全量歷史資料以最佳化效能。 - 資料快取:鑑於基金淨值更新頻率通常為交易日每日一次,建議在本地實施適當的資料快取策略,減少重複API呼叫。
接入示例程式碼
提供 Shell、Python、Go、Java、PHP 等常見接入示例,便於直接接到現有專案裡。
請求示例
{
"fundCode": "基金代码",
"period": "取值说明:取值1:近一个月;取值2:近3个月;取值3:近6个月;取值4:近一年;取值5:近三年;取值6:近五年;取值7:今年以来;取值8:成立以来\t"
}響應示例
{
"code": 200,
"msg": "成功",
"taskNo": "914968093149234333232591",
"data": {
"list": [
{
"date": "2024-06-30",
"totalValue": 0.8379,
"fundCode": "018124",
"netValue": 0.8379,
"dayOfGrowth": -0.01
}
]
}
}請求欄位
以下欄位根據示例 JSON 自動提取,僅作接入參考。
| 欄位路徑 | 型別 | 示例值 |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.fundCode | object | {...} |
| properties.fundCode.type | string | string |
| properties.fundCode.description | string | 基金代码 |
| properties.period | object | {...} |
| properties.period.type | string | string |
響應欄位
以下欄位根據示例 JSON 自動提取,僅作接入參考。
| 欄位路徑 | 型別 | 示例值 |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.code | object | {...} |
| properties.code.type | string | number |
| properties.code.example | number | 200 |
| properties.code.description | string | 返回码,详见返回码说明 |
| properties.msg | object | {...} |