开发者

get top 20 google results c# api

I've been trying to write something similar to this but without any success so I was wondering if there is any google API or any other "function" which would allow me to do the following

List<string> GetTop20Links (string keyword)
{
//code to d开发者_Python百科ownload and return top 20 results (links) in List<string> format
}  


I prefer to use Google API for .NET.


As far as I can determine from google's blogs, there once was (and maybe is still operational) a SOAP webservice that let you query structured search results. But you need a so called API key for the query and they don't give them out any more. The successor to this service was claimed to be the AJAX search API, but I cannot find any current reference to it.

On the google API page there is a custom search service, but you have to give a specific set of websites that the search includes and you either need to show the ads along with the results or pay some fee for the usage.

You see, it's not in google's interest to let somebody easily query their search engine and then just use the results for whatever purpose. They are making money through the ads, that's their business model.

So if you want to realize that function you would have to turn to html-scraping which is ugly at best, tends to break often and is difficult to get right.

BTW: You can do that quite easily with bing. There is a link to the Bing Search API here and a code sample here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜