Web News

Key Success Factors for Offshore Outsourcing to India
In today s sourcing business, many companies are offshoring IT services and projects to India, some as a Captive Center (employment of own Indian staff), others choose external service providers for delivery. ...

Sony Imageworks opens visual effects studio in Chennai
Imageworks India, the Indian arm of Sony Pictures Imagework, Thursday announced opening of its state-of-the-art facility in Chennai. The Chennai facility has about 90 artists and technical experts and would be scaled up to 180 workers, the company said here.

India, China nowhere in top league of networked...
Despite its status as a world leader in information technology, India does not figure among the top 20 of the world's most networked economies. In fact it has slipped four places to rank 50 in the Global...


04.10.08

Google REST Search API

By Philipp Lenssen

Google half-way cancelled their SOAP API a while ago, but they now* offer a parametrized URL that returns a JSON data set.

Google says this REST approach is useful for "Flash developers, and those developers that have a need to access the AJAX Search API from other Non-Javascript environments." This may be even simpler to use than the SOAP API, though I wonder how long (and how well) it's going to be working. Here's an example query:

ajax.googleapis.com/ajax/services/
search/web?v=1.0&q=hello%20world


This URL format can also be adjusted to grab results from video search, book search and so on.

While the URL has the word AJAX in the string and this is officially part of the Google AJAX Search API, this has nothing to do with AJAX per se, as the URL can be called from other environments, including the server side. All you need is a JSON library to parse the results (JSON means JavaScript Object Notation, though it also doesn't require JavaScript). The Yahoo Search API already utilizes a similar approach, though it can return XML as well.

Call Today For a Free Domain Consult

Eugenius, who noted this in the forum, says "I'm wondering if Google opened up this channel so that App Engine developers would have Python access to it's search, translation, and feed-cache products?"

On the other hand, it's also fairly easy to just screenscrape Google results, though it may be against your netiquette as it may require ignoring the robots.txt file by Google (Google's robots guidelines disallow direct bot-spidering of their search results). The bonus is that it can work on any kind of Google result as well as any website, whether the site provides an API or not. Here's a PHP5 sample that grabs the Google top 10 results, for instance - to PHP it doesn't matter whether the Google result page is valid HTML (let alone valid XHTML), it just parses pretty much anything into a neat object model that is searchable via XPath:



[Thanks Eugenius!]

Comments

About the Author:
Philipp Lenssen from Germany, author of 55 Ways to Have Fun With Google, shares his views & news on the search industry in the daily Google Blogoscoped.
About DevWebPro India
DevWebPro India is for professional developers ... those who build and manage applications and sophisticated websites. DevWebPro India delivers via news and expert advice New Strategies In Development.





DevWebPro India is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com NetworkNewz.com





-- DevWebPro India is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2008 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


New Strategies In Development DevWebPro India News Archives About Us Feedback DevWebPro India Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact