bing每日图片官方接口:

https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=8

其中,format可选xml和js(json)

idx代表向前第几天的数据,0为当天,1为前一天

n代表每次返回的张数,最大为8

idx和n组合使用,测试最早返回当前日期15天前的数据 

返回结果:

{
"images": [{
"startdate": "20191008",
"fullstartdate": "201910080700",
"enddate": "20191009",
"url": "/th?id=OHR.WorldOctopus_EN-CN1134231846_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp",
"urlbase": "/th?id=OHR.WorldOctopus_EN-CN1134231846",
"copyright": "Octopus spotted during a night dive near Kona, Hawaii (© Jeff Milisen/Alamy)",
"copyrightlink": "https://www.bing.com/search?q=octopus&form=hpcapt&filters=HpDate%3a%2220191008_0700%22",
"title": "Let's celebrate cephalopods",
"quiz": "/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20191008_WorldOctopus%22&FORM=HPQUIZ",
"wp": true,
"hsh": "4324ca30d92e268433940d37b824a51e",
"drk": 1,
"top": 1,
"bot": 1,
"hs": []
}],
"tooltips": {
"loading": "Loading...",
"previous": "Previous image",
"next": "Next image",
"walle": "This image is not available to download as wallpaper.",
"walls": "Download this image. Use of this image is restricted to wallpaper only."
}
}

url前边拼接上https://www.bing.com即为完整图片地址

使用urlbase可拼接不同分辨率的图片

title和copyright为介绍和版权说明


标签: WEB开发, 图片

发表评论

Our Happy Clients