The query string Bing uses is:
http://www.bing.com/search?q=&src=IE-SearchBox&FORM=IE8SRC
(this is the template URL from the Bing search provider in IE). All you have to do is insert your search terms after the q
parameter. A good way to test this is to actually execute a search and see the url in the address box of the browser:
http://www.bing.com/search?q=how+to+query+bing&src=IE-SearchBox&FORM=IE8SRC
you can drop the src
and FORM
parameters, Bing will just be using those for statistical purposes.
To get the results to appear in your own page, use an iframe, give it an id, and sets its src url (using javascript) to the search url you have constructed.
var frame = document.getElementById('mySearchFrame');
if (frame != null)
frame.src = 'http://www.bing.com/search?q=' + mySearchTerms;
Note that if you want to style the page then you will have to query Bing from code behind and "scrape" the results and place them into your own page. (Or you could just send the page back but modify the contents of it before doing so, but to do this will be violating Bing's terms of use - MS supply Bing for you to use for free, but it is on their terms, which means you will not be able to delete any advertising or change the look and feel of the page - there are no free rides in this world :).