接口用途

龙虎榜查询。量脉接口成功时业务码多为 200;网关将量脉返回的 JSON 置于响应 data 中,结构与量脉返回一致。

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

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

参数说明

参数名称是否必填说明示例
date日期必填日期,格式 yyyy-MM-dd2024-01-15

返回字段说明

以下为量脉 data 对象内常见并列数组字段(键名区分大小写,以实际响应为准)。

字段类型说明
totalVolumestring总成交量
reasonstring上榜原因
chgstring涨跌幅%
endDatestring截至日期
sellAmountRatiostring占总成交比例%
topAmountstring龙虎榜成交额(万元)
buyAmountRatiostring占总成交额比例%
totalAmountstring总成交额(万元)
thsCodestring股票代码
buyAmountstring买入额(万元)
sellAmountstring卖出额(万元)
namestring名称
closestring收盘价
turnoverstring换手率

调用示例

Python
import requests

url = "https://liangmai.pro/api/gateway"
params = {
    "token": "YOUR_TOKEN",
    "api": "lhb_daily",
    "date": "2024-01-15",
}
r = requests.post(url, params=params)
print(r.json())
PHP
$url = "https://liangmai.pro/api/gateway";
$data = [
    'token' => 'YOUR_TOKEN',
    'api' => 'lhb_daily',
    'date' => '2024-01-15',
];
$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: "lhb_daily",
    date: "2024-01-15",
});

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

更新与限流

数据更新:交易日约 15:30 后更新(以量脉数据为准)。

相关接口