Google Search History as RSS #

Update on 4/24/2006: The feeds have now been officially announced (i.e. they are exposed via auto-discovery on the page). HTTP Basic Authentication (over SSL) is now also supported (in addition to the cookie).

Google recently released some Dashboard Widgets, among them one for accessing your search history. Until now, it had only been accessible at its homepage, so I wondered how the widget got that data out. Thankfully the widget code was not obfuscated, and I was able to see snippets like the following:

  Widget.feed = "http://www.google.com/searchhistory/find?zx=" + 
              randomString() + "&num=50&output=rss&client=google-mcsmhwidget";
  ...
  var url = Widget.feed;
  url += "&start=" + Widget.resultsStart;
  url += "&q=" + encodeURIComponent(query);

Sure enough, URLs such as this one bring up a search through my search history as an RSS feed. The query part of the URL can be left blank to show all items. I'm guessing that by judicious use of the start and num parameters, one could even get at ones entire search history. Presumably the attention fanboys will like this.

The key in the above URL seems to be the output=rss parameter. Since bookmarks are in the same UI as search history, perhaps they can be viewed as RSS too? Yes, they can (though with some XML errors that the team is aware of as of 3/31/2006 it's well-formed XML ). The Trends page however doesn't work as RSS.

Note that these feeds are not really useful for most aggregators, since they require you to logged in to your Google Account and be authenticated by a cookie. The one exception might be Firefox Live Bookmarks. By creating one pointed to your searches or bookmarks feeds and putting it your toolbar, you have one-click access to your search history or bookmarks. However, the real use of the feeds is as a pseudo-API, as they are used in the Dashboard Widget.

This might seem like a convenient "leak," but it's something I decided to blog about for myself, without any prompting from the search history team (though they did get a heads-up about this post). The feed URLs and format may change at any time, though they probably won't deviate too much unless there's a good reason.

9 Comments

Wow, non-well-formed RSS feeds protected by cookies. I can't imagine why they kept that a secret.
Wow, non-well-formed RSS feeds protected by cookies. Works great in my web browser. :)
I sincerely doubt that, like everything else you say Robert.
Well, one day I hope to have as much credibility as Mark Pilgrim.
Since you do happen to work for Google, I'm surprised this came in so late! :P

Anyway, at the moment, what I'm more concerned with is Google Search RSS or JSON. That way, one will be able to search Google and display the results without actually having to display the results page. If Google can implement this, I know a lot of people will appreciate this, and run amock to add this to their page ... I know I will! :)

Do you know anything about any plans to have this?
This looks very interesting to me. My biggest challenge actually using this is figuring out how to aggregate my search history from the various Google accounts I hop in and out of all day long. I have a personal and many different business related G accounts, so end up surfing with whichever account I logged into last. This makes finding previously visited sites using search history very challenging.
@ed kohler: why don't you give www.feeddigest.com a go? or save them as live bookmarks?
Good idea, Aditya. I'll give that a try.
Strange. My del.icio.us bookmarks (or at least some of them) flash on the Google bookmarks screen for a second and then the screen says "No bookmarks to import".

Bizarre. Anyway have any ideas?

Post a Comment