No, there is no way to retrieve results in XML rather than JSON. You  
can find JSON parsers for Java and a number of other languages,  
though, at http://www.json.org

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
http://jgeerdes.blogspot.com
http://jgeerdes.wordpress.com
[email protected]

Unless otherwise noted, any price quotes contained within this  
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights  
Wesleyan Church!

And check out my blog, Adventures in Web Development, at 
http://jgeerdes.blogspot.com 
  !


On Jul 25, 2009, at 2:32 PM, Mike Norman wrote:

>
> I am experimenting with the REST interface into Google AJAX Search in
> Java
> and I would like to know if there is a way to force the returned
> contents to be
> in XML instead of JSON?
>
> ...
> getEstimatedResultcount(String site, String keyword) {
>    URL url = new URL("http://ajax.googleapis.com/ajax/services/search/
> web?v=1.0&q=" +
>        keyword + "+site%3A" + site);
>    URLConnection connection = url.openConnection();
>    String line;
>    StringBuilder builder = new StringBuilder();
>    BufferedReader reader = new BufferedReader(newInputStreamReader(
>       connection.getInputStream()));
>    while((line = reader.readLine()) != null) {
>        builder.append(line);
>    }
> }
>
> Is it possible to add something like "+output:XML" to the URL or
> perhaps a
> 'Content-Type=text/xml' setting on the message header?
>
> Any help would be greatly appreciated,
> Mike
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-AJAX-Search-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to