必应壁纸
必应壁纸
参数 | 必填 | 类型 | 说明 |
---|---|---|---|
format | 否 | string | 返回数据格式,不存在返回xml格式 js (返回json格式,一般使用这个) xml(返回xml格式) |
idx | 否 | string | 请求图片截止天数 0 今天 -1 截止至明天(预准备的) 1 截止至昨天,类推(目前最多获取到16天前的图片) |
n | 是 | string | 1-8 返回请求数量,目前最多一次获取8张 |
mkt | 否 | string | 地区 zh-CN ... |
自制接口
- PHP 示例代码
<?php
$json_string = file_get_contents('https://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=zh-CN');
$data = json_decode($json_string, true);
$url = 'https://cn.bing.com' . $data['images'][0]['url'];
header("Location: {$url}");
?>
Bing每日壁纸档案库
Bing官方提供了壁纸获取接口。不过Bing官方提供的API接口只能获取当日及过去7天的历史壁纸,再往前就获取不到了。
接口 | 说明 |
---|---|
https://bing.img.run/uhd_302.php | 输出Bing每日壁纸UHD超高清原图。 |
https://bing.img.run/1920x1080_302.php | 输出Bing每日壁纸1080P高清。 |
https://bing.img.run/1366x768_302.php | 输出Bing每日壁纸普清。 |
https://bing.img.run/m_302.php | 输出Bing每日壁纸手机版1080P高清。 |
https://bing.img.run/rand_uhd.php | 随机获取Bing历史壁纸UHD超高清原图。 |
https://bing.img.run/rand.php | 随机获取Bing历史壁纸1080P高清。 |
https://bing.img.run/rand_1366x768.php | 随机获取Bing历史壁纸普清。 |
https://bing.img.run/rand_m.php | 随机获取Bing历史壁纸手机版1080P高清。 |