Click here to Skip to main content
13,346,708 members (66,372 online)
Click here to Skip to main content
Add your own
alternative version


43 bookmarked
Posted 4 Jul 2005

Search Your Website with MSN Search

, 4 Jul 2005
Rate this:
Please Sign up or sign in to vote.
Use MSN search RSS results to display site specific search results on your own website.

Sample Image


When the new MSN search was launched it didn't take me long to notice the RSS button at the bottom of each search result listing. At first I thought the notion was completely absurd. In all honesty I could not think of any good reason to subscribe to search results in an RSS reader or you mail client. As I investigated a little bit more, I noticed that the results were driven by the query string and that I could in fact adjust my results by adjusting the query string. I quickly realized that you could include MSN search results in your application or web site by aggregating this data. Like Google search, MSN supports the search word "", so by combining these two features you can create a search engine for your own site using MSN's results.


In the example above, I am building the query string on the fly with the search string typed in my web form. I then parse the RSS feed with an XSL style sheet and display the results. The pagination is accomplished by passing parameters to the XSL file and handling the pagination within the XSL. To view this example, click the link above.

Using the code

As you can see, the search works very well and is very fast. You can try searching my site for something like "ASP" or "XML" to generate a sufficient amount of search results.

I am making my code available for download. Please feel free to download it and use it on your site. It will work on any server that will run ASP.NET. There are only two variables that you need to change to personalize the search results in your site. In the ASPX file, you will find two variables "sitename" and "resultcount". sitename is the fully qualified domain name of your site and resultcount specifies the total number of results to return. You may want to adjust this based on the amount of content you have. The less total results you download on each query, the faster it will run.

Points of Interest

Also though it may be difficult for Microsoft to track where its feed is being used, the licensing information within the RSS file specifically states that the results are not to be used for commercial purposes. As I understand Google API is free for all for up to 1,000 searches per day. So if you are building a commercial web site, I would recommend using the Google search API, but if you are just looking to implement a great quick search on your personal web site, then MSN site search is a great choice. If you do decide to use this script on your web site, please post a link so I can take a look.


  • 6/7/2005 - Released.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Jason Witty
Software Developer (Senior)
United States United States
For more articles please visit my website:

A Programmers Journal

You may also be interested in...

Comments and Discussions

QuestionHow do I highlight or bold the searchterm in the search results? Pin
fernanda zettel26-Jul-10 12:27
memberfernanda zettel26-Jul-10 12:27 

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.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180111.1 | Last Updated 4 Jul 2005
Article Copyright 2005 by Jason Witty
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid