1
I need to search for any term in Google and get a list of the results of this search. I’m trying to do this using the Google Custom Search API but I’m not getting satisfactory results.
For example, when I seek the term "bidding" with my code I get 1,510,000 results. When I search the same term directly in the browser I get 11,800,000 results.
How do I get all 11,800,000 of that research?
Below is my code in C#:
static void Main(string[] args)
{
string apiKey = "AIzaSyCVGlnfsGaaJ3HYTHVu6OH_jBaIFJQYrH0";
string cx = "013638634553566051485:xwnfxqp2pso";
string query = "licitações";
var svc = new Google.Apis.Customsearch.v1.CustomsearchService(
new BaseClientService.Initializer { ApiKey = apiKey });
var listRequest = svc.Cse.List(query);
listRequest.Cx = cx;
var search = listRequest.Execute(); //listRequest.Fetch(); This method has been removed
foreach (var result in search.Items)
{
Console.WriteLine("Title: {0}", result.Title);
Console.WriteLine("Link: {0}\n", result.Link);
}
Console.ReadKey();
}