| 接口地址:https://cn.apihz.cn/api/xinwen/baidurg.php | 
|---|
| 返回格式:json | 
| 请求方式:get/post | 
| 请求示例:https://cn.apihz.cn/api/xinwen/baidurg.php?id=1&key=1 | 
| 名称 | 类型 | 必填 | 说明 | 
|---|---|---|---|
| id | int | 必填 | 用户中心的数字ID:10004093 | 
| key | string | 必填 | 用户中心通讯秘钥 扫码关注公众号 | 
| 名称 | 类型 | 说明 | 
|---|---|---|
| time | string | 该榜单数据在接口盒子的缓存时间戳 | 
| time2 | string | 该榜单数据在接口盒子的缓存时间 | 
| data | array | 结果数据集 | 
| query | string | 热搜内容 | 
| word | string | 关键内容 | 
| desc | string | 描述 | 
| hotChange | string | 热度变化 | 
| hotScore | string | 热度值 | 
| hotTag | string | 热度标签 | 
| hotTagImg | string | 热度标签图标 | 
| img | string | 内容图片 | 
| index | string | 排名 | 
| rawUrl | string | 搜索地址1 | 
| url | string | 搜索地址2 | 
| appUrl | string | 搜索地址3 | 
| show | string | 类型 | 
{
	"code": 200,
	"time": 1745120402,
	"time2": "2025-04-20 11:40:02",
	"data": [{
		"appUrl": "https://m.baidu.com/s?word=%E7%8E%8B%E5%BF%83%E5%87%8C%E7%94%BB%E8%B4%A8%E6%98%AF%E4%BB%80%E4%B9%88%E6%A2%97&sa=fyb_phrase",
		"desc": "王心凌(霸总版)画质",
		"expression": "https://search-operate.cdn.bcebos.com/rebang/emoji/face_aligei.png",
		"hotChange": "",
		"hotScore": "2180",
		"hotTag": "5",
		"hotTagImg": "https://search-operate.cdn.bcebos.com/88cd2b09219da7dc3af3fe179621061a.png",
		"id": 59433,
		"img": "",
		"index": 0,
		"indexUrl": "",
		"query": "王心凌画质是什么梗",
		"rawUrl": "https://m.baidu.com/s?word=%E7%8E%8B%E5%BF%83%E5%87%8C%E7%94%BB%E8%B4%A8%E6%98%AF%E4%BB%80%E4%B9%88%E6%A2%97",
		"show": [],
		"url": "https://m.baidu.com/s?word=%E7%8E%8B%E5%BF%83%E5%87%8C%E7%94%BB%E8%B4%A8%E6%98%AF%E4%BB%80%E4%B9%88%E6%A2%97&sa=fyb_phrase",
		"word": "王心凌画质"
	}]
}| 错误码 | 说明 | 
|---|---|
| 400 | 错误信息提示 | 
<?php
/**
 * Created by PhpStorm.
 * User: FZS
 * Time: 2025/4/20 07:11
 */
class freeApi
{
    private $apiUrl;
    public function __construct()
    {
        $this->apiUrl = 'https://cn.apihz.cn/api/xinwen/baidurg.php?id=1&key=1';
    }
    /**
     * 获取结果
     * @return array
     */
    public function getResult()
    {
        return file_get_contents($this->apiUrl);
    }
}package main
import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)
const (
	APIURL   = "https://cn.apihz.cn/api/xinwen/baidurg.php?id=1&key=1"
)
func main() {
	queryUrl := fmt.Sprintf("%s",APIURL)
	resp, err := http.Get(queryUrl)
	if err != nil {
		log.Println(err)
		return
	}
	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(string(body))
}