热搜
其他 官方文档
热搜
基本说明:
接口地址:https://test.harumoe.cn/api/other/hot
返回格式:json
请求方式:get
请求示例:https://test.harumoe.cn/api/other/hot?list=baidu,csdn&cache=true&lang=zh-cn
请求参数说明:
名称 类型 必填 说明
list string 必填 需要被获取的热搜,baidu百度,csdn
cache bool 必填 是否获取缓存数据(默认缓存30分钟)
lang string 选填 语言类型(zh-cn、ru-ru、en-us、ja-jp、ko-kr)默认值:zh-cn
返回参数说明:
名称 类型 说明
- - 见json
JSON返回示例:
{
	"code": 200,
	"msg": "数据请求成功!",
	"data": {
		"baidu": [],
		"csdn": [{
				"period": "2023-07-11-15",
				"hotRankScore": "29941",
				"pcHotRankScore": "3.0w",
				"loginUserIsFollow": false,
				"nickName": "perfiffer",
				"avatarUrl": "https://profile-avatar.csdnimg.cn/default.jpg!1",
				"userName": "x1172031988",
				"articleTitle": "记一次阿里云被挖矿处理记录",
				"articleDetailUrl": "https://blog.csdn.net/x1172031988/article/details/131613743",
				"commentCount": "19",
				"favorCount": "233",
				"viewCount": "9458",
				"hotComment": null,
				"picList": [
					"https://img-blog.csdnimg.cn/ac2f8160d76743f3b339a7d937b9ced8.png"
				],
				"isNew": null,
				"productId": "131613743",
				"productType": "blog",
				"recommendType": "ali",
				"report_data": null
			},
			{
				"period": "2023-07-11-15",
				"hotRankScore": "18270",
				"pcHotRankScore": "1.8w",
				"loginUserIsFollow": false,
				"nickName": "阿Q说代码",
				"avatarUrl": "https://profile-avatar.csdnimg.cn/69c7847eafe2491da58b4bbd910e2aee_qingai521.jpg!1",
				"userName": "Qingai521",
				"articleTitle": "【网络安全】带你了解什么是【黑客】",
				"articleDetailUrl": "https://blog.csdn.net/Qingai521/article/details/131637803",
				"commentCount": "87",
				"favorCount": "84",
				"viewCount": "1231",
				"hotComment": null,
				"picList": [
					"https://img-blog.csdnimg.cn/12127c02e13b4c3f9e9835617d201f0d.jpeg"
				],
				"isNew": null,
				"productId": "131637803",
				"productType": "blog",
				"recommendType": "ali",
				"report_data": null
			}
		]
	}
}
服务级错误码参照
错误码 说明
- -
完整教学代码示例
<?php
/**
 * Created by PhpStorm.
 * User: FZS
 * Time: 2023/06/05 14:26
 */
class freeApi
{
    private $apiUrl;

    public function __construct()
    {
        $this->apiUrl = 'https://test.inis.cn/api/other/hot?list=baidu,csdn&cache=true&lang=zh-cn';
    }

    /**
     * 获取结果
     * @return array
     */
    public function getResult()
    {
        return file_get_contents($this->apiUrl);
    }
}
package main

import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)

const (
	APIURL   = "https://test.inis.cn/api/other/hot?list=baidu,csdn&cache=true&lang=zh-cn"
)

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))
}