接口用途
返回涨跌停热度、关注度与近期重要事件。
请求地址
POST https://liangmai.pro/api/gateway统一网关调用,query 参数携带 token(访问令牌)与 api=factors_sentiment(接口名),其余为业务参数。
参数说明
| 参数 | 名称 | 是否必填 | 说明 | 示例 |
|---|---|---|---|---|
ts_code | 股票代码 | 必填 | 股票代码(可传 ts_code / code / symbol,6 位;带后缀自动规范为 6 位) | 600519 |
返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
code | string | 股票代码,如 600519 |
name | string | 股票名称 |
trade_date | string | 因子交易日,YYYYMMDD |
update_time | string | 服务端计算完成时间,YYYY-MM-DD HH:mm:ss |
report_period | string | 财务类可选,如 2026Q2 |
calc_version | string | 口径版本,如 1.0 |
limit_up_count_20d | int/null | 近 20 日涨停次数 |
limit_down_count_20d | int/null | 近 20 日跌停次数 |
attention_score | int/null | 关注度 0–100;数据源待接入,当前按设计返回空(赠品合理范围) |
attention_rank | int/null | 关注度降序排名(第三步) |
recent_event | string/null | 近期重要事件类型或 none(第三步) |
event_date | string/null | 事件日 YYYYMMDD(第三步) |
event_impact | string/null | positive / negative / neutral(第三步) |
调用示例
Python
import requests
url = "https://liangmai.pro/api/gateway"
params = {
"token": "YOUR_TOKEN",
"api": "factors_sentiment",
"ts_code": "600519",
}
r = requests.post(url, params=params)
print(r.json())PHP
$url = "https://liangmai.pro/api/gateway";
$data = [
'token' => 'YOUR_TOKEN',
'api' => 'factors_sentiment',
'ts_code' => '600519',
];
$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: "factors_sentiment",
ts_code: "600519",
});
fetch("https://liangmai.pro/api/gateway", {
method: "POST",
body: params
})
.then(r => r.json())
.then(data => console.log(data));更新与限流
数据更新:涨跌停每日批算;关注度/事件依原料更新频率 ·