百度游戏热搜榜
百度游戏热搜榜
接口信息
| 项目 | 内容 |
|---|---|
| 接口地址 | https://api.code410.com/api/hot/baidu_game |
| 返回格式 | application/json |
| 请求方式 | HTTP GET POST/JSON |
| 更新日期 | 2023-09-03 |
| 调用权限 | 免费开放 |
| 每日限制 | 无限制 |
| 请求频率限制 | 1秒5次 |
请求示例
https://api.code410.com/api/hot/baidu_game请求 HEADER
| 名称 | 值 |
|---|---|
| Content-Type | application/x-www-form-urlencoded;charset; |
返回参数说明
| 名称 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码 |
| msg | string | 状态信息 |
| data | string | 请求结果数据集 |
| data.content | string | 游戏热搜榜内容数据集 |
| data.content.word | string | 游戏名字 |
| data.content.desc | string | 游戏简介 |
| data.content.hotChange | string | 热度变化 |
| data.content.hotScore | string | 热度值 |
| data.content.img | string | 游戏图片 |
| data.content.index | string | 指数排名 (数值越小,排名越前) |
| data.content.query | string | 游戏搜索关键词 |
| data.content.url | string | 游戏搜索链接 |
| data.content.show | string | 游戏信息 |
| debug | string/array | 调试数据 |
| exec_time | float | 执行耗时 |
| user_ip | string | 客户端IP |
错误码参照
| 错误码 | 类型 | 说明 |
|---|---|---|
| 403 | int | 没有权限 |
| 400 | int | 参数传递不正确 |
| 500 | int | 服务器内部错误 |
在线调试 / 完整文档
本接口为 信息查找 分类下的开放接口。完整文档、在线调试与示例代码请前往 https://api.code410.com/doc/205。
返回示例
{
"code": 200,
"msg": "请求成功",
"data": {
"content": [
{
"word": "原神",
"desc": "陌生的天空下,少年少女立于尘沙。你们是一对旅行中的双子,从世界之外漂流而来。你的血亲被陌生的神灵带走,而你也被神封印,陷入沉眠。再度醒来,天地间风景已变……《原神》是由米哈游自研的一款全新开放世界冒险RPG。你将在游戏中探索一个被称作「提瓦特」的幻想世界。在这广阔的世界中,你可以踏遍七国,邂逅性格各异、能力独特的同伴,与他们一同对抗强敌,踏上寻回血亲之路;也可以不带目的地漫游,沉浸在充满生机的世界",
"hotChange": "up",
"hotScore": "100449",
"img": "https://fyb-1.cdn.bcebos.com/fyb-1/20230320/59202905374ccc5f0835be507a504028",
"index": 0,
"query": "原神 游戏",
"url": "https://www.baidu.com/s?wd=%E5%8E%9F%E7%A5%9E+%E6%B8%B8%E6%88%8F&sa=fyb_game_all&rsv_dl=fyb_game_all",
"show": [
"类型:单机游戏"
]
},
{
"word": "王者荣耀",
"desc": "S28赛季开启:狂沙之外,坚守所在。",
"hotChange": "up",
"hotScore": "74444",
"img": "https://fyb-1.cdn.bcebos.com/fyb-1/20230320/be4bfe5b0b216b677effc33d1fd3f1d2",
"index": 1,
"query": "王者荣耀 游戏",
"url": "https://www.baidu.com/s?wd=%E7%8E%8B%E8%80%85%E8%8D%A3%E8%80%80+%E6%B8%B8%E6%88%8F&sa=fyb_game_all&rsv_dl=fyb_game_all",
"show": [
"类型:手机游戏"
]
},
{
"word": "和平精英",
"desc": "重启未来前方2050 黑刃航母来袭 重启未来版本正式开启",
"hotChange": "up",
"hotScore": "52695",
"img": "https://fyb-1.cdn.bcebos.com/fyb-1/20230320/aef5d40fd3abd37e73bf11d663114156",
"index": 2,
"query": "和平精英 游戏",
"url": "https://www.baidu.com/s?wd=%E5%92%8C%E5%B9%B3%E7%B2%BE%E8%8B%B1+%E6%B8%B8%E6%88%8F&sa=fyb_game_all&rsv_dl=fyb_game_all",
"show": [
"类型:手机游戏"
]
}
]
},
"exec_time": 0.758,
"ip": "197.149.235.178"
}
// (content 共 30 项,此处仅展示前 3 项)示例代码
// jQuery-Ajax
$.ajax({
url: 'https://api.code410.com/api/hot/baidu_game',
data: {
// 该接口无需参数
},
type: 'GET',
dataType: 'json',
success: function (data) {
console.log(data); // 请求成功,输出结果
},
error: function () {
console.log('请求失败');
}
});import requests
url = "https://api.code410.com/api/hot/baidu_game"
params = {
# 该接口无需参数
}
res = requests.get(url, params=params)
print(res.json())const https = require('https');
const url = 'https://api.code410.com/api/hot/baidu_game';
https.get(url, res => {
let data = '';
res.on('data', chunk => data += chunk);
res.on('end', () => console.log(JSON.parse(data)));
}).on('error', err => console.error(err));package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
resp, err := http.Get("https://api.code410.com/api/hot/baidu_game")
if err != nil {
fmt.Println("http get error", err)
return
}
defer resp.Body.Close()
result, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(result))
}import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Test {
public static void main(String[] args) {
try {
URL url = new URL("https://api.code410.com/api/hot/baidu_game");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.connect();
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
String line;
StringBuilder sb = new StringBuilder();
while ((line = reader.readLine()) != null) sb.append(line);
reader.close();
System.out.println(sb.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program {
static async Task Main() {
HttpClient client = new HttpClient();
string url = "https://api.code410.com/api/hot/baidu_game";
HttpResponseMessage response = await client.GetAsync(url);
string body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
}<?php
$url = "https://api.code410.com/api/hot/baidu_game";
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);curl "https://api.code410.com/api/hot/baidu_game"在线调试
该接口无需参数,直接点击下方按钮发起请求。
填写参数后点击「发起请求」查看实时返回结果。
