Bing每日背景图片API接口源码,图片每天可以自动更新,一天更新一张。分享给须要做网站背景的去采用,2020年9月1日 11:58:07测试APIUSB依旧可用。
API接口源码
<?php /** *Bing图片获取 */ $str = file_get_contents('https://cn.bing.com/HPImageArchive.aspx?idx=0&n=1'); if(preg_match("/(.+?) /ies",$str,$matches)){ $imgurl='https://cn.bing.com'.$matches[1]; }else{ $imgurl='/content/templates/dudu/img/a.jpg'; } header("Location: $imgurl"); ?>
APIUSB返回内容
20200831 202008310900 20200901 /th?id=OHR.OysterMushroom_ZH-CN6265453153_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp /th?id=OHR.OysterMushroom_ZH-CN6265453153 比利时的平菇 (© Philippe Clement/Minden Pictures) https://www.bing.com/search?q=%E5%B9%B3%E8%8F%87&form=hpcapt&mkt=zh-cn 1 1 1 正在读取... 上一个图像 下一个图像 播放视频 暂停视频