views:

258

answers:

3

How can I get Google search results from inside a program? I need to get an array of search results for a specified string.

+5  A: 

Use their javascript search API http://code.google.com/apis/ajaxsearch/

They no longer support their SOAP search api unfortunately

Charles Ma
For non-javascript environments they do have a REST search api. http://code.google.com/apis/ajaxsearch/documentation/#fonje
Brandon Bodnár
+5  A: 

C++ requires a little more work then other languages. You will need to connect to Google's REST Search API and then use a JSON parser to parse out the search results. Json.org has a collection of JSON parsers in various languages.

Brandon Bodnár
A: 

Google offers Ajax API for JavaScript programmers and a poor documentation for Python, PHP and Flash.By the way, If you are able to connect to remote http server with any other c++ library, you can do it. just change the url you are using and point it to: http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q={My_CPP_Query} You will get JSON data stream, that you will be able to work with.

P.M