Google’s Suggest feature is lighting up the blogosphere these days. It functions as like autocomplete for your search box, where Google attempts to determine what you are searching for and gives you suggestions. Web tinkerer that I am, I had to dig in a little and see how this works.
The script handles the onkeydown event of the search box. When that fires, it grabs the contents of the search box and sends the contents to a Google server for suggestions.
A request to the suggestion server looks like this:
Hacked appropriately, this could be a cool tool for generating related searches to a given keyword. Here’s a quick, first attempt – I put together some sample code that grabs Google’s suggestion for a given keyword (or partial). GPL’ed PHP source code is included.
Oh yeah – you might be interested in my earlier post about hacking Adsense for Feeds.