接口用途
南向资金历史每天走势。可通过阶段参数可选近一月、近六月、近一年、全部的历史数据,对应的参数为1、6、12、all,按照交易日升序排序。
请求地址
POST https://liangmai.pro/api/gateway统一网关调用,query 参数携带 token(访问令牌)与 api=northbound_south_trend(接口名),其余为业务参数。
参数说明
| 参数 | 名称 | 是否必填 | 说明 | 示例 |
|---|---|---|---|---|
jd | 统计阶段 | 必填 | 统计阶段:1=近一月、6=近六月、12=近一年、all=全部 | 1 |
返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
nx | number | 南向资金净流入(百万) |
ggth | number | 港股通(沪)净流入(百万) |
ggts | number | 港股通(深)净流入(百万) |
t | string | 日期:yyyy-MM-dd |
调用示例
Python
import requests
url = "https://liangmai.pro/api/gateway"
params = {
"token": "YOUR_TOKEN",
"api": "northbound_south_trend",
"jd": "1",
}
r = requests.post(url, params=params)
print(r.json())PHP
$url = "https://liangmai.pro/api/gateway";
$data = [
'token' => 'YOUR_TOKEN',
'api' => 'northbound_south_trend',
'jd' => '1',
];
$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: "northbound_south_trend",
jd: "1",
});
fetch("https://liangmai.pro/api/gateway", {
method: "POST",
body: params
})
.then(r => r.json())
.then(data => console.log(data));更新与限流
数据更新:每日20:10 ·