It\'s relatively easy to parse the output of the AJAX API using a scripting language:
#!/usr/bin/env python import urllib import json base = \'http://ajax.goog
I ended up using curl's --data-urlencode option to encode the query parameter and just sed for extracting the first result.
curl -s --get --data-urlencode "q=example" http://ajax.googleapis.com/ajax/services/search/web?v=1.0 | sed 's/"unescapedUrl":"\([^"]*\).*/\1/;s/.*GwebSearch",//'