接口用途
沪股通(港>沪)成分股行情明细,按涨跌幅降序。
请求地址
POST https://liangmai.pro/api/gateway统一网关调用,query 参数携带 token(访问令牌)与 api=northbound_sh_component(接口名),其余为业务参数。
返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
dm | string | 代码 |
mc | string | 名称 |
fm | number | 五分钟涨跌幅(%) |
h | number | 最高价(元) |
hs | number | 换手(%) |
lb | number | 量比(%) |
l | number | 最低价(元) |
lt | number | 流通市值(元) |
o | number | 开盘价(元) |
pe | number | 市盈率(动态,总市值除以预估全年净利润,例如当前公布一季度净利润1000万,则预估全年净利润4000万) |
pc | number | 涨跌幅(%) |
p | number | 当前价格(元) |
sz | number | 总市值(元) |
cje | number | 成交额(元) |
ud | number | 涨跌额(元) |
v | number | 成交量(手) |
yc | number | 昨日收盘价(元) |
zf | number | 振幅(%) |
zs | number | 涨速(%) |
sjl | number | 市净率 |
zdf60 | number | 60日涨跌幅(%) |
zdfnc | number | 年初至今涨跌幅(%) |
t | string | 更新时间yyyy-MM-ddHH:mm:ss |
调用示例
Python
import requests
url = "https://liangmai.pro/api/gateway"
params = {
"token": "YOUR_TOKEN",
"api": "northbound_sh_component",
}
r = requests.post(url, params=params)
print(r.json())PHP
$url = "https://liangmai.pro/api/gateway";
$data = [
'token' => 'YOUR_TOKEN',
'api' => 'northbound_sh_component',
];
$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_sh_component",
});
fetch("https://liangmai.pro/api/gateway", {
method: "POST",
body: params
})
.then(r => r.json())
.then(data => console.log(data));更新与限流
数据更新:每日20:10 ·