知乎实时热搜榜API

实时获取知乎热搜榜

API 文档

请求参数说明:

名称 必填 类型 说明
type string 查询的类型

返回参数说明:

名称 类型 说明
success string 返回状态的真假
title string 热搜名称
subtitle string 小标题
update_time string 访问接口的时间
data.index string 热搜列表序号
data.title string 热搜列表标题
data.hotTag string 是否热门
data.hot string 点击量
data.url string 热搜链接
data.mobilUrl string 热搜链接
copyright string 版权声明

返回示例:

{
    "success": true,
    "title": "知乎热榜",
    "subtitle": "热度",
    "update_time": "2024-11-22 03:11:01",
    "data": [
        {
            "index": 1,
            "title": "王宝强被举报涉嫌欺诈,未履行《八角笼中》票房分成承诺,当事人成都恩波俱乐部已报案,具体情况如何?",
            "hotTag": "hot",
            "hot": "660万",
            "url": "https:\/\/www.zhihu.com\/question\/4755690514",
            "mobilUrl": "https:\/\/www.zhihu.com\/question\/4755690514"
        },
        {
            "index": 2,
            "title": "2025 年考研报名人数为 388 万,比去年减少 50 万,考研人数连续两年大降,反应了什么趋势?",
            "hotTag": null,
            "hot": "637万",
            "url": "https:\/\/www.zhihu.com\/question\/4736912829",
            "mobilUrl": "https:\/\/www.zhihu.com\/question\/4736912829"
        }
    ],
    "copyright": "善恶聚合热搜榜,源码获取联系QQ3951157"
}

错误码格式说明:

名称 类型 说明
true bool 返回状态为真
false bool 返回状态为假(参数未填写正确)

代码示例:

<?php
// 初始化cURL会话
$ch = curl_init();
// 设置请求URL,用户中心获取token,自行替换其他参数
curl_setopt($ch, CURLOPT_URL, "https://api.ba9.cn/api/get.zhihuhot?type=zhihu");
// 设置请求头
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: YOUR_TOKEN'
));
// 返回响应而不是直接输出
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// 执行请求并获取响应
$response = curl_exec($ch);
// 关闭cURL会话
curl_close($ch);
// 将响应解析为JSON格式
$data = json_decode($response, true);
// 输出JSON数据
print_r($data);
?>
暂无示例
暂无示例
暂无示例
暂无示例
暂无示例
暂无示例