接口用途

根据《所有基金列表》得到的基金代码作为参数得到该基金的历史净值,按净值日期降序。

请求地址POST https://liangmai.pro/api/gateway

统一网关调用,query 参数携带 token(访问令牌)与 api=fund_nav_history(接口名),其余为业务参数。

参数说明

参数名称是否必填说明示例
fund_code基金代码必填基金代码(6 位)510300

返回字段说明

字段类型说明
dmstring基金代码
mcstring基金名称
tstring净值日期
dwjzstring单位净值
ljjzstring累计净值
zzlstring日增长率
sgztstring申购状态
shztstring赎回状态
fhspstring分红送配

调用示例

Python
import requests

url = "https://liangmai.pro/api/gateway"
params = {
    "token": "YOUR_TOKEN",
    "api": "fund_nav_history",
    "fund_code": "510300",
}
r = requests.post(url, params=params)
print(r.json())
PHP
$url = "https://liangmai.pro/api/gateway";
$data = [
    'token' => 'YOUR_TOKEN',
    'api' => 'fund_nav_history',
    'fund_code' => '510300',
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
echo $res;
JavaScript
const params = new URLSearchParams({
    token: "YOUR_TOKEN",
    api: "fund_nav_history",
    fund_code: "510300",
});

fetch("https://liangmai.pro/api/gateway", {
  method: "POST",
  body: params
})
  .then(r => r.json())
  .then(data => console.log(data));

更新与限流

数据更新:每周六13:00 ·

相关接口