Re: querying google from java application

57 views
Skip to first unread message

Jeremy Geerdes

unread,
May 22, 2013, 1:49:33 PM5/22/13
to google-ajax...@googlegroups.com
According to the documentation, you can retrieve up to 8 results by including &rsz=8 in your query string (i.e., before &q=). You can then iterate through up to 8 "pages" of results like this using &start=[8 | 16 | 24 | 32 | 40 | 48 | 56] (again, adding it to your query string). This means that you can get a maximum total of 64 results from the Web Search API.

That said, you will want to note 2 things.

1. There are a number of points in your description which may violate the API's TOS. Namely, your stated objected to "saves all results of a google search" is concerning because it implies that you may be using your application to query the API in an automated fashion. Spiders, robots, crawlers, etc., are all prohibited by the TOS. Also, saving results must be done in direct response to user actions. I.e., you're not allowed to simply store all of Google's results into a database or some other store. I would strongly suggest reviewing the TOS before proceeding with your application.

2. The Web Search API (ajax.googleapis.com...) has been deprecated for more than 24 months now. You can expect it to be discontinued no later than May 2014. If your application will still be in use past that point, you will want to find an alternative. For example, the Custom Search API (CSAPI) can be used in conjunction with a Custom Search Engine to make up to 10,000 requests per day (though you can only get 100 requests/day free).

jg



On Wed, May 22, 2013 at 12:04 PM, Roberto di Lallo <dilallo...@gmail.com> wrote:
Hi, 
i'm writing a java application that saves all results of a google search. I have a problem: i query google using this http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q= with attached my query, but  when i try to itering results (from JSON) it has only 4 element. How can i have all the elements?
Thank you

Roberto 

--
--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit
https://groups.google.com/d/msgid/google-ajax-search-api/65fa5b1e-1e7b-45a2-a765-a482f2824f0d%40googlegroups.com?hl=en_US
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-ajax-searc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

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

Roberto di Lallo

unread,
May 23, 2013, 10:57:35 AM5/23/13
to google-ajax...@googlegroups.com
Thank you very much for your answer. I don't think my applications violate the API's TOS because i don't want to save all the results but only manage these. I mean, i want to give to the user that use the application the possibility to choose waht result to save. I know that the web API search hav been deprecated but using the customer search engine i don't know how to manage results. 
Thank you for your help

Roberto
Reply all
Reply to author
Forward
0 new messages