bing-wallpaper
bing-wallpaper copied to clipboard
A RESTful API to fetch daily wallpaper from Bing.com
Bing Wallpaper API
A RESTful API to fetch daily wallpaper from Bing.com
Usage
API
- API Address: https://bing.biturl.top
- Method:
HTTP GET
Parameters
resolutionThe resolution of wallpaper image.1920is the default value, you can also use1366and3840(4K resolution).formatThe response format, can bejsonorimage. If response format is set asimage, you will be redirected to the wallpaper image directly.indexThe index of wallpaper, starts from 0. By default,0means to get today's image,1means to get the image of yesterday, and so on. Or you can specify it asrandomto choose a random index between 0 and 7.mktThe region parameter, the default value iszh-CN, you can also useen-US,ja-JP,en-AU,en-UK,de-DE,en-NZ,en-CA. You can also set it asrandomto choose the region randomly.
Example
- Request
https://bing.biturl.top/?resolution=1920&format=json&index=0&mkt=zh-CN
- Response
{
"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 background image
You can also use this API to set CSS background image:
background-image: url(https://bing.biturl.top/?resolution=1920&format=image&index=0&mkt=zh-CN);
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
Demo

Run with docker
Get the latest version of docker image:
docker pull timothyye/bing:latest
Start the container with the image name & tag (YYYYMMDD or latest), for example:
docker run -d --name=bing-wallpaper --restart=always -p 9000:9000 timothyye/bing:latest
For development
Build it
git clone https://github.com/TimothyYe/bing-wallpaper.git
make build
Run it
bw/bw run