Google Search API for C#
Asked Answered
S

2

6

Now that Google's discontinued their SOAP API, what can I use to search from C# code?

I know they have a Javascript AJAX API – I've implemented it and it works – but I just need to do the same thing but from the backend code.

Superiority answered 5/4, 2010 at 18:57 Comment(2)
Google has a lot of APIs - it would help to know what you are trying to do from your back-end C# code.Clonus
Search and retrieve the results of that search.Superiority
I
3

The AJAX API has a RESTful interface. Have a look here in the section titled "Flash and other Non-Javascript Environments"

For Flash developers, and those developers that have a need to access the Web Search API from other Non-Javascript environments, the API exposes a simple RESTful interface. In all cases, the method supported is GET and the response format is a JSON encoded result set with embedded status codes.

Influence answered 5/4, 2010 at 19:44 Comment(0)
C
4

This is a piece of code, just for the record:

var searchTerm = "ABCD";
using (var web = new WebClient())
{
    web.Headers.Add("Referrer", "http://your-website-here/");
    var result = web.DownloadString(String.Format(
           "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q={0}&key=your-key-here", 
           searchTerm));
    Console.WriteLine(result);
}
Cahill answered 14/10, 2010 at 8:33 Comment(0)
I
3

The AJAX API has a RESTful interface. Have a look here in the section titled "Flash and other Non-Javascript Environments"

For Flash developers, and those developers that have a need to access the Web Search API from other Non-Javascript environments, the API exposes a simple RESTful interface. In all cases, the method supported is GET and the response format is a JSON encoded result set with embedded status codes.

Influence answered 5/4, 2010 at 19:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.