Wall Script
Follow Me:
Thursday, February 24, 2011

Bing Instant Search with Jquery and Ajax

Some days back I had posted a popular article 'Youtube instant search with Jquery and Ajax'. I received a lot of request from my readers that asked to me how to instant web search results so I had coded Bing instant search with real time search results. Just few lines of code, reading Bing search JSON API file with Jquery.

Bing Instant Search

Download Script     Live Demo

First you have to create an application ID from Bing Developer Center.

Javascript Code
$(".search_input").keyup(function(){})- search_input is the class name of input tag. $(this).val() - calling the input search box value. The encodeURIComponent() function encodes special characters (More infomation). Replace your Bing APP_ID
<script type="text/javascript" src="http://ajax.googleapis.com/
<script type="text/javascript">

var search_input = $(this).val();
var keyword= encodeURIComponent(search_input);
// Bing Search API 
var bing_url='http://api.search.live.net/json.aspx?JsonType=callback&JsonCallback=?&Appid=APP_KEY&query='+keyword+'&sources=web';

type: "GET",
url: bing_url,
success: function(response)
$.each(response.SearchResponse.Web.Results, function(i,data)
var title=data.Title;
var dis=data.Description;
var url=data.Url;

var final="<div class='webresult'><div class='title'><a href='"+url+"'>"+title+"</a></div><div class='desc'>"+dis+"</div><div class='url'>"+url+"</div></div&gt;";

$("#result").append(final); // Result

$("#result").html("<div id='no'>No Results</div>");
// HTML code
<input type="text" class='search_input' />
<div id="result">

Bing JSON file
JSON file keyword
"SearchTerms":"srinivas tamada"
"Title":"Srinivas Tamada",
"Description":"Current. CEO at Egglabs. Dr M.G.R University Recommendations 1 recommendation Connections",


margin:0 auto;
border:2px solid #333;
font-family:'Georgia', Times New Roman, Times, serif;
.title a
border-bottom:1px dashed #dedede;
Suriya said...

hi Srini its really a great search process keep doing the good job...

iv0id said...


thanks you for this tutorial but i have a question, can we change the code so that the results came from a database that we created ?

btcorp said...


So do it!

Srinivas Tamada said...


Try this


Anonymous said...

it 's beautiful bing api. but can i use with google api ?

DamnCoolSites said...

I'm really glad to have found this blog!, and it
really looks interesting. thanks to the author.. your blog is VERY cool :D

Anonymous said...

Olá, tem como eu exportar os links dos resultados para uma Arry em php?

Fiquem com Deus.

salvaxp1 said...

very good indeed


Ramakrishnan said...

amazing script. srini keeps going on to discover

Anonymous said...

Em php ficaria como?

Beben Koben said...

like google result now bing search LoL
nice nice nice

Ashish said...

Is there any code similar to like this where we can search all three Google, Yahoo and Bing at same time ??

Srinivas Tamada said...


Try www.kokkoroko.com

Anonymous said...

I'm trying to use this for an image search, but can't seem to figure out how to get a thumbnail image for a result. Any suggestions?

Design Cavern said...

I will try to make one for me ;) fast search

TWITROCK said...

Nice script, thank you bro :)

Young Consumer said...

it's very good but showing only 10 results....any idea to get more results on the page.

Urbanspaceman said...

here is my InfiniteSearch adapted for image

nayya said...

hey can you please mail me complete zip file of this code...am having some problem and i need it urgent

Anonymous said...

Hi is there an insidious bug in the code? It seems to me that you are assuming that the callback launched for the prefix P will conclude before the callback launched for the string Px (i.e. the prefix P followed by the character x). If this is the case, there is no guarantee for this

Anonymous said...

In other words the engine can answer for P after Px. So the result of P will come later and override the one of Px.

Anonymous said...

open source meta search engine:


Anonymous said...

for more results....change line
var bing_url='http://api.search.live.net/json.aspx?JsonType=callback&JsonCallback=?&Appid=APP_KEY&query='+keyword+'&sources=web&Web.count=30';

Tullio said...

I insert the fine script go --> http://www.tulliomarra.it

muraliz said...

it retries only 10 result at a time, how about paginations, and result in more pages ?

Anonymous said...


How do I fix this error
"response.SearchResponse.Web is undefined"?


Dennis Landman said...

paginations would be very interesting (-:

Tutorials and teasers said...

thnx a lot

dynamind said...

hey, the things you do are really impressive, is their a parameter for language specific search filtering? I'm getting a lot results in chinese and so on, things I can't read.

dynamind said...

woohoo, got it language specific, adopted it from search set to german: the parameter is &FORM=R5FD

Anonymous said...

Is there a way to do this with the phonebook API?

Anonymous said...

Hello Srinivas,
Wonderful tutorial as always. I need a little help. I am able to successfully implement bing instant web search, image search, looking forward to implement bing instant news search now. Can you guide me? A link where I can get some hints would be enough
Thank you :)

jeet said...

hello sir,
is there any way to get bing news search by using the same script??
Thank you :)

Anonymous said...

Thanx 4 this. Is there a way to make it get data directly frm the server database instead of using api?

Anonymous said...

no pagination how can i edit pagination like 1 2 3 pages or next page

Anonymous said...

how can i search google?

not google api, can i retrieve with file_get_contents and regexp?

Anonymous said...

Anybody know how to make this work with the new Azure API?

Post a Comment