接口用途
根据《所有基金列表》得到的基金代码作为参数得到该基金的历年投资股票组合,按截止时间降序。
请求地址
POST https://liangmai.pro/api/gateway统一网关调用,query 参数携带 token(访问令牌)与 api=fund_stock_holding(接口名),其余为业务参数。
参数说明
| 参数 | 名称 | 是否必填 | 说明 | 示例 |
|---|---|---|---|---|
fund_code | 基金代码 | 必填 | 基金代码(6 位) | 510300 |
返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
jd | string | 季度 |
t | string | 截止时间 |
dm | string | 股票代码 |
mc | string | 股票名称 |
jzbl | string | 占净值比例 |
cgs | string | 持股数(万股) |
ccsz | string | 持仓市值(万元) |
调用示例
Python
import requests
url = "https://liangmai.pro/api/gateway"
params = {
"token": "YOUR_TOKEN",
"api": "fund_stock_holding",
"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_stock_holding',
'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_stock_holding",
fund_code: "510300",
});
fetch("https://liangmai.pro/api/gateway", {
method: "POST",
body: params
})
.then(r => r.json())
.then(data => console.log(data));更新与限流
数据更新:每周六13:00 ·