Bing每日壁紙API


懶人直接出圖

https://www.shadow-forum.com/api/bing/bing.php

API

相關參數

  • resolution 壁紙的分辨率. 1920 為默認值, 你也可以將其設置為 1366.
  • format API的調用返回格式, 值可以為 json 或者 image. 如果返回格式設置為 image, API會直接跳轉請求到對應的圖片地址.
  • index 壁紙的index,默認從0開始。由於Bing壁紙的圖片每日更新,所以通過index值可以獲取之前的圖片。
  • mkt Bing壁紙的地區參數,默認為 zh-CN, 你也可以將其設置為 en-USja-JPen-AUen-UKde-DEen-NZen-CA

調用示例

  • API請求
1
https://bing.biturl.top/?resolution=1920&format=json&index=0&mkt=zh-CN
  • 返回
1
2
3
4
5
6
7
{
"start_date": "20181118",
"end_date": "20181119",
"url": "https://www.bing.com/az/hprichbg/rb/NarrowsZion_ZH-CN9686302838_1920x1080.jpg",
"copyright": "錫安國家公園內的維爾京河,美國猶他州 (© Justinreznick/Getty Images)",
"copyright_link": "http://www.bing.com/search?q=%E9%94%A1%E5%AE%89%E5%9B%BD%E5%AE%B6%E5%85%AC%E5%9B%AD\\u0026form=hpcapt\\u0026mkt=zh-cn"
}

CSS中設置背景圖片

可以使用此API直接在CSS中設置背景圖片:

1
2
3
background-image: url(https://bing.biturl.top/?resolution=1920&format=image&index=0&mkt=zh-CN);
background-size: 100%;
background-repeat: no-repeat;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM