Skip to content
A RESTful API to fetch daily wallpaper from Bing.com
Go Dockerfile Makefile
Branch: master
Clone or download
Latest commit 9ab0aa5 Nov 4, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bw update pkg references Nov 19, 2018
cmd/run update pkg references Nov 19, 2018
handler update pkg references Nov 19, 2018
model implement xml parser Nov 18, 2018
vendor add xml parser Nov 18, 2018
.gitignore finish response parser Nov 18, 2018
Dockerfile
LICENSE Initial commit Nov 16, 2018
Makefile update Makefile Nov 4, 2019
README.md update Makefile Nov 4, 2019
go.mod
go.sum update Dockerfile May 21, 2019

README.md

Bing Wallpaper API

A RESTful API to fetch daily wallpaper from Bing.com

Usage

API

Parameters

  • resolution The resolution of wallpaper image. 1920 is the default value, you can also use 1366.
  • format The response format, can be json or image. If response format is set as image, you will be redirected to the wallpaper image directly.
  • index The index of wallpaper, starts from 0.
  • mkt The region parameter, default is zh-CN, you can also use en-US, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA.

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-image: url("img_girl.jpg");
background-size: cover;

Demo

https://biturl.top

https://github.com/TimothyYe/biturl/blob/master/screenshots/1.jpg?raw=true

Run with docker

Get the code and build docker image:

git clone https://github.com/TimothyYe/bing-wallpaper.git
make release

Start the container with the image name & tag (YYYYMMDD), 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
You can’t perform that action at this time.