ccg
ccg

Reputation: 313

Google's autocomplete in my form

I have a form on my website which forwards the textbox input to www.google.com/search?q=.... Is there any possibility to get this autocomplete / autofill features google provides when searching over google.com. Firefox uses google's autocomplete function in the search bar next to the url bar, but how can I get this kind of information for my web form?

Upvotes: 5

Views: 6710

Answers (4)

RafaSashi
RafaSashi

Reputation: 17205

In addition to RickyA´s answer you can filter the suggestion by media using bs parameter:

http://clients1.google.com/complete/search?hl=en&q=stackoverflow&output=toolbar&ds=

youtube: ds=yt

books: ds=bo

products: ds=sh

news: ds=n

images: ds=i

web: ds=

recipes: ds=r

Upvotes: 1

RickyA
RickyA

Reputation: 16029

The new url is:

http://suggestqueries.google.com/complete/search?client=firefox&q=YOURQUERY

the client part is required; I did't test other clients.

Upvotes: 1

ceasar
ceasar

Reputation: 1522

Here an complete example with google auto suggest

http://googlesuggest-jquery.googlecode.com/svn/trunk/

Upvotes: 3

iblue
iblue

Reputation: 30414

There was the Google Suggest API that allowed to use autocomplete on custom keywords. But it seems google has removed it. But I found out that you can still access the API. There are URLs for JSON and XML.

JSON

http://clients1.google.com/complete/search?hl=en&q=<your query here>&client=hp

XML

http://clients1.google.com/complete/search?hl=en&q=<your query here>&output=toolbar

Without any warranty.

If you want to get autocomplete on a text box. You can combine that with jQuery UI Autocomplete

Upvotes: 6

Related Questions