Reputation: 313
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
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
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
Reputation: 1522
Here an complete example with google auto suggest
http://googlesuggest-jquery.googlecode.com/svn/trunk/
Upvotes: 3
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.
http://clients1.google.com/complete/search?hl=en&q=<your query here>&client=hp
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