Skip to content

必应壁纸api以及jsonp调用

//request
api: https://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en_us
cookie:ENSEARCH=BENVER=1;
如果不加cookie那么返回的图片为非高清版本
//response
{
"images": [
{
"startdate": "20200923",
"fullstartdate": "202009230700",
"enddate": "20200924",
"url": "/th?id=OHR.GoldenGinkgo_EN-CN3678294241_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp",
"urlbase": "/th?id=OHR.GoldenGinkgo_EN-CN3678294241",
"copyright": "Golden ginkgo leaves at Xuanwu Lake Park in Nanjing, Jiangsu Province, China (© SIPA Asia/ZUMA Wire/Alamy)",
"copyrightlink": "https://www.bing.com/search?q=ginkgo+biloba+tree&form=hpcapt&filters=HpDate%3a%2220200923_0700%22",
"title": "A tree of many memories",
"quiz": "/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20200923_GoldenGinkgo%22&FORM=HPQUIZ",
"wp": true,
"hsh": "5039e3482e23bd514d300dc125242191",
"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."
}
}

如果你网站要用的话,为了安全浏览器默认是禁止跨越调用的。可以用简单的json封装一下;

callbackName(response)

我用go封了一个demo可供下载 github