Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google custom search REST number of results (num field)

I'm trying to figure out how to force google custom search to give me back 20 results per page. I've tried to send this REST request configuring my new Custom Search Engine to: Standard edition: Free, ads are required on results pages.

https://www.googleapis.com/customsearch/v1?key=AIzaSyCgGuZie_Xo-hOECNXOTKp5Yk7deryqro8&cx=015864032944730029962:5ipe0q27hgy&q=test&alt=json&num=20

IT NOT WORKS!

but

https://www.googleapis.com/customsearch/v1?key=AIzaSyCgGuZie_Xo-hOECNXOTKp5Yk7deryqro8&cx=015864032944730029962:5ipe0q27hgy&q=test&alt=json&num=10

IT WORKS!

But reading documentation at

https://developers.google.com/custom-search/docs/xml_results#numsp

it says that:

Optional. The num parameter identifies the number of search results to return.

The default num value is 10, and the maximum value is 20. If you request more than 20 results, only 20 results will be returned.

Note: If the total number of search results is less than the requested number of results, all available search results will be returned.

Someone has experienced this problem?

PS: I've tried also to send that REST request configuring my new Custom Search Engine to: Site Search: Starts at $100 per year, ads are optional on results pages.

But nothing has changed no way to obtain 20 results in a request/page

like image 979
wildnove Avatar asked Nov 30 '12 11:11

wildnove


1 Answers

This documentation url has descriptions of each parameter. It also says num is restricted to integers between 1 and 10, inclusive.

https://developers.google.com/custom-search/v1/using_rest#query-params

like image 112
dre Avatar answered Oct 02 '22 18:10

dre