接口用途
沪深A股静态市盈率、动态市盈率排名,静态市盈率以最近一个年度收益进行计算,动态市盈率以最近四个季度的单季收益进行计算。
请求地址
POST https://liangmai.pro/api/gateway统一网关调用,query 参数携带 token(访问令牌)与 api=monitor_pe_rank(接口名),其余为业务参数。
返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
t | string | 日期yyyy-MM-dd |
dm | string | 代码 |
mc | string | 名称 |
c | number | 收盘价 |
zdf | number | 涨跌幅(%) |
v | number | 成交量(股) |
hs | number | 换手率(%) |
jpe | number | 静态市盈率:总市值除以上年度净利润 |
dpe | number | 市盈率(TTM):最新价除以最近4个季度的每股收益 |
调用示例
Python
import requests
url = "https://liangmai.pro/api/gateway"
params = {
"token": "YOUR_TOKEN",
"api": "monitor_pe_rank",
}
r = requests.post(url, params=params)
print(r.json())PHP
$url = "https://liangmai.pro/api/gateway";
$data = [
'token' => 'YOUR_TOKEN',
'api' => 'monitor_pe_rank',
];
$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: "monitor_pe_rank",
});
fetch("https://liangmai.pro/api/gateway", {
method: "POST",
body: params
})
.then(r => r.json())
.then(data => console.log(data));更新与限流
数据更新:每日20:10 ·