A RESTful API for Bing wallpaper that redirects to the image directly
Based on the project: https://github.com/zenghongtu/bing-wallpaper
Built with Hono and deployed on Cloudflare Workers.
<img src="https://bing-wallpaper-api.jcolladosp.workers.dev/?width=800"/>
Endpoint: https://bing-wallpaper-api.jcolladosp.workers.dev
The resolution of wallpaper image. Default is 1920x1080.
Option values:
UHD1920x12001920x10801366x7681280x7681024x768800x600800x480768x1280720x1280640x480480x800400x240320x240240x320
The response format, can be json. If not set, it will be redirected to the wallpaper image directly.
The index of wallpaper, starts from 0. By default, 0 means to get today's image, 1 means to get the image of yesterday, and so on. Negative number is reverse sort, -1 will get the earliest wallpaper. Or you can specify it as random to choose a random index.
Get wallpaper by date, from 20190309 to today (format is YYYYMMDD).
The width of the wallpaper.
The height of the wallpaper.
The quality of wallpaper, from 0 to 100.
- Request
https://bing-wallpaper-api.jcolladosp.workers.dev/?resolution=UHD&index=random&width=1000&format=json
- Response
{
"startdate": "20220105",
"copyright": "Plate-billed mountain toucan in Bellavista Cloud Forest Reserve, Ecuador (© Tui De Roy/Minden Pictures)",
"urlbase": "/th?id=OHR.MountainToucan_EN-US7120632569",
"title": "A plate-billed mountain toucan",
"url": "https://www.bing.com/th?id=OHR.MountainToucan_EN-US7120632569_UHD.jpg&w=1000"
}You can also use this API to set CSS background image:
background-image: url(https://bing-wallpaper-api.jcolladosp.workers.dev/?index=random);
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;