必應官網:https://cn.bing.com/
返回Json數據的接口
https://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1
返回結果:
{
"images": [
{
"startdate": "20190604",
"fullstartdate": "201906041600",
"enddate": "20190605",
"url": "/th?id=OHR.PeruvianRainforest_ZH-CN4066508593_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp",
"urlbase": "/th?id=OHR.PeruvianRainforest_ZH-CN4066508593",
"copyright": "祕魯亞馬遜坦博帕塔國家保護區中的樹冠 (© Patrick Brandenburg/Tandem Stills + Motion)",
"copyrightlink": "http://www.bing.com/search?q=%E6%A0%91%E5%86%A0&form=hpcapt&mkt=zh-cn",
"title": "",
"quiz": "/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20190604_PeruvianRainforest%22&FORM=HPQUIZ",
"wp": true,
"hsh": "73a0f621c340498bb1abbfb4abf79258",
"drk": 1,
"top": 1,
"bot": 1,
"hs": []
}
],
"tooltips": {
"loading": "正在加載...",
"previous": "上一個圖像",
"next": "下一個圖像",
"walle": "此圖片不能下載用作壁紙。",
"walls": "下載今日美圖。僅限用作桌面壁紙。"
}
}
其中字段url
就是圖片地址,但是隻有一半,需要加一個前綴。
地址前綴https://www.bing.com/
和http://s.cn.bing.net
都可以。
即完整的圖片地址爲
http://s.cn.bing.net/th?id=OHR.PeruvianRainforest_ZH-CN4066508593_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp
或者
https://www.bing.com/th?id=OHR.PeruvianRainforest_ZH-CN4066508593_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp