Click here to Skip to main content
12,446,146 members (24,105 online)
Click here to Skip to main content
Add your own
alternative version


9 bookmarked

Bing Image Download

, 30 Jan 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
Microsoft's Bing has some amazing images as backgrounds. With this code you can create a Windows Service or any other type of application to automate the image download process, then set the Windows Desktop backgrounds to use the designated folder.


Microsoft’s Bing has some amazing images as backgrounds; however, if you want to use them as background images for your Windows Desktop, you must go through the tedious process of opening your browser and saving the image as a background each day.

Unless you can automate the process that is.

Finding the images

The first step in the process is to find the images. Since they are the background on the webpage, the image must be downloaded to your Temporary Internet Files folder; however, these files have sometimes cryptic names, can be removed when cleaning the temporary files, and of course, you must visit Bing to initiate the download.

Long Zheng at has created an excellent archive of all Bing images, yet the problem is, through there is an RSS feed available, they are not downloadable directly from this site. There are instructions available here: on creating a Theme file using the RSS feed; however, I’ve found this method to be unreliable.

Through some investigation, I found the image information is available from Bing using this URL:

As the format parameter indicates, this will return an XML formatted stream that contains information such as the date the images is for, the relative URL, description, and copyright information.

The idx parameter tells where you want to start from. 0 would start at the current day, 1 the previous day, 2 the day after that, etc. For instance, if the date were 1/30/2011, using idx = 0, the file would start with 20110130; using idx = 1, it would start with 20110129; and so forth.

The n parameter tells how many images to return. n = 1 would return only one, n = 2 would return two, and so on.

The mkt parameter tells which of the eight markets Bing is available for you would like images from. The valid values are: en-US, zh-CN, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA.

Automating the download

Now that you know where to get the images from, it is easy to create an automated process to download them.

public class BingImages
    private const string DOWNLOAD_PATH = @"D:\BingImages";
    private const string BING = "";
    private const string IMG_URL = "" + 
    private static string[] Markets = new string[] { "en-US", "zh-CN", 
                                      "ja-JP", "en-AU", "en-UK", 
                                      "de-DE", "en-NZ", "en-CA" };
    private const int NUMBER_OF_IMAGES = 1;

    /// <span class="code-SummaryComment"><summary>

With this code, you can create a Windows Service or any other type of application to automate the download process, then set the Windows Desktop backgrounds to use the designated folder.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

You may also be interested in...


Comments and Discussions

GeneralMy vote of 5 Pin
Adrian Grigoriu22-Feb-13 0:13
memberAdrian Grigoriu22-Feb-13 0:13 
QuestionPhp Conversion possible for this code? Pin
Herit Shah17-Jan-13 11:13
memberHerit Shah17-Jan-13 11:13 
QuestionHow to obtain URL for high-res bing wallpaper from XML file Pin
SeanKD20-Oct-12 17:42
memberSeanKD20-Oct-12 17:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160811.3 | Last Updated 30 Jan 2011
Article Copyright 2011 by Not Active
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid