Mutual Fund Trend Data
Mutual fund trend data
Documentation
API Overview
This API provides financial data query services based on fund codes. Upon entering a fund code, it returns the fund's type (e.g., hybrid, stock, bond), gain/loss data across various time dimensions (last week, month, quarter, half-year, year), and a list of historical fund trends including specific dates and net asset values. This data is suitable for applications requiring fund performance display.
Use Cases
- Financial News Apps: Display recent performance and historical net asset value curves on fund detail pages.
- Investment Advisor Analysis Tools: Quickly compare yield changes of different funds over specific periods.
- Personal Accounting/Wealth Management Software: Help users track periodic gains and losses of their held funds.
- Data Visualization Dashboards: Serve as a backend data source to render long-term fund trend charts.
Request and Response Details
- Request Method: POST
- Core Parameters:
fundCode(string, required), the unique code of the target fund. - Response Data:
fundType: Fund classification identifier (BLEND Hybrid, STOCK Equity, INDEX Index, BOND Bond, CURRENCY Money Market).lastWeek/lastMonth/lastQuarter/lastHalfYear/lastYear: Gain/loss values for each period (Note: The returned value is a decimal; it needs to be multiplied by 100% to convert to a percentage for display).fundAndIndexYieldVoPair: Contains the fund name and afundTrendsarray, where each object in the array includesreportDate(timestamp) andvalue(unit net asset value), used for drawing trend charts.
Integration Suggestions
- Value Processing: The gain/loss returned by the API is in decimal format (e.g., -0.3620); please ensure it is converted to percentage format (-36.20%) for frontend display.
- Timestamp Conversion:
reportDateandserverTimeare both millisecond-level timestamps; they need to be converted to a standard date format during parsing. - Caching Strategy: Fund net asset values are typically updated on trading days, and data remains unchanged during non-trading hours. It is recommended to set an appropriate cache time (e.g., 24 hours) for requests with the same
fundCodeto reduce API call costs and improve response speed. - Error Handling: Please check the returned
codefield; 200 indicates success. Other status codes require combining with themsgfield for error prompts.
Integration Examples
Includes ready-to-use Shell, Python, Go, Java, and PHP examples for direct integration.
Request Example
{
"fundCode": "基金代码"
}Response Example
{
"code": 200,
"msg": "成功",
"taskNo": "200495341220681616635742",
"data": {
"fundType": "BLEND",
"lastYear": "-0.3620",
"lastQuarter": "-0.1032",
"serverTime": 1722409638300,
"lastMonth": "-0.0221",
"lastHalfYear": "-0.1331",
"lastWeek": "-0.0124",
"fundAndIndexYieldVoPair": [
{
"name": "中航混改精选混合型证券投资基金A类",
"trendType": "INDEX_CODE-sz399300",
"fundTrends": [
{
"code": "20171027000230030000000000014020",
"codeType": "PRODUCT_ID",
"reportDate": 1714406400000,
"name": "中航混改精选混合型证券投资基金A类",
"value": "0.810300"
}
]
}
]
}
}Request Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.fundCode | object | {...} |
| properties.fundCode.type | string | string |
| properties.fundCode.description | string | 基金代码 |
| required | array | "fundCode" |
| required[] | string | fundCode |
Response Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| 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 | {...} |