返回首页

【搜图】毒霸的wallpaper搜索

浏览: 72774 最后更新: 2024-12-21 15:30:49

接口说明

【搜图】毒霸的wallpaper搜索,动态壁纸哦

接口基本信息

API地址

https://api.cenguigui.cn/api/wallpaper/

请求方式

GET

返回格式

JSON

接口状态

正常启用

参数说明

以下参数为接口所需调用信息

参数 是否必填 类型 说明 示例
msg需要搜索的动漫图片
page页数,默认1
limit返回数量,默认30
typeandroid/pc,安卓和pc端,默认android(安卓)

请求示例

HTTP请求

https://api.cenguigui.cn/api/wallpaper/api.php?msg=动物&type=android&page=1&limit=30

调用示例

代码示例

安卓端:
https://api.cenguigui.cn/api/wallpaper/api.php?msg=风景&type=android&page=1&limit=30

pc端:
https://api.cenguigui.cn/api/wallpaper/api.php?msg=风景&type=pc&page=1&limit=30

返回结果

HTTP 200 OK
{
    "code": 200,
    "msg": "success",
    "data": [
        {
            "id": 237718,
            "name": "矮脚小奶猫",
            "cname": "动物",
            "author": "简单控",
            "author_uid": 486050,
            "format": "MP4",
            "decs": "治愈,可爱,喵星人,猫,#动物#可爱#萌宠#治愈#清新",
            "phone_img_url": "https://mobile-img-baofun.zhhainiao.com/pcwallpaper_ugc_mobile/preview_jpg/317b6aa3f7947f6fc752c4b48b8e3607.jpg",
            "web_img_url": "https://mobile-img-baofun.zhhainiao.com/pcwallpaper_ugc_mobile/preview/f5fb42672917ee006c9885905433bc39_preview_mid.jpg",
            "mov_url": "https://mobile-img-baofun.zhhainiao.com/pcwallpaper_ugc_mobile/live/f5fb42672917ee006c9885905433bc39.mov",
            "video_url": "https://mobile-img-baofun.zhhainiao.com/pcwallpaper_ugc_mobile/preview/f5fb42672917ee006c9885905433bc39_preview.mp4",
            "time": "2022-09-23 11:10:26"
        },
        {
            "id": 396601,
            "name": "可爱壁纸",
            "cname": "动物",
            "author": "木槿壁纸",
            "author_uid": 65999383,
            "format": "MP4",
            "decs": "治愈,清纯,护眼,萌宠,海洋生物,野生动物,清晰护眼",
            "phone_img_url": "https://mobile-img-baofun.zhhainiao.com/pcwallpaper_ugc_mobile/preview_jpg/271cc1f79fb5859b3901d91a1adf084c.jpg",
            "web_img_url": "https://mobile-img-baofun.zhhainiao.com/pcwallpaper_ugc_mobile/preview/1b007ef85a26be39d99cd13f379e5566_preview_mid.jpg",
            "mov_url": "https://mobile-img-baofun.zhhainiao.com/pcwallpaper_ugc_mobile/live/1b007ef85a26be39d99cd13f379e5566.mov",
            "video_url": "https://mobile-img-baofun.zhhainiao.com/pcwallpaper_ugc_mobile/preview/1b007ef85a26be39d99cd13f379e5566_preview.mp4",
            "time": "2023-10-02 20:31:01"
        }
    ],
    "tips": "笒鬼鬼api",
    "time": "2024-11-01 04:08:24"
}

调用示例

// JavaScript调用示例
fetch("https://api.cenguigui.cn/api/wallpaper/api.php?msg=动物&type=android&page=1&limit=30", {
  method: "GET",
  headers: {
    "Content-Type": "application/json"
  }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
# Python调用示例
import requests

url = "https://api.cenguigui.cn/api/wallpaper/api.php?msg=动物&type=android&page=1&limit=30"

response = requests.get(url)

print(response.json())
// Java调用示例
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;

public class ApiExample {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newBuilder()
                .version(HttpClient.Version.HTTP_2)
                .connectTimeout(Duration.ofSeconds(10))
                .build();
                
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://api.cenguigui.cn/api/wallpaper/api.php?msg=动物&type=android&page=1&limit=30"))
                .build();
                
        client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
                .thenApply(HttpResponse::body)
                .thenAccept(System.out::println)
                .join();
    }
}
<?php
// PHP调用示例
$url = "https://api.cenguigui.cn/api/wallpaper/api.php?msg=动物&type=android&page=1&limit=30";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
?>
// C#调用示例
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        var url = "https://api.cenguigui.cn/api/wallpaper/api.php?msg=动物&type=android&page=1&limit=30";
        
        var response = await client.GetAsync(url);
        
        var result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}