7 points · by schtog · 18y ago · 8 comments
Searchengines generally do a good job of sorting out relevant data/links but they rarely ever take you all the way to the goal.
So I have some different webapps I'm working on and I would like to query Google or some other searchengine for a subject and then go through those links and present the relevant information.
I could obv write something to do this, but is it allowed? Or I have to pay for this service at Google? If so, is there some automated way to do this?
Google quietly re-introduced their search API a few months ago under the guise of the "Ajax Search API that doesn't require JavaScript" - it requires you to provide a referrer which is a bit weird, but it should work OK: http://code.google.com/apis/ajaxsearch/documentation/#fonje
Just get a Yahoo-ID and download the API. The following code searches for Zlatan Ibrahimovic and prints the top 40 results:
from yahoo.search.web import WebSearch
srch = WebSearch(app_id="YahooDemo", query = "Zlatan Ibrahimovic", results = 9)
for res in srch.parse_results():
print res.UrlI'd imagine other languages have similar libraries.