简体   繁体   English

Google自定义搜索API javascript

[英]Google Custom Search API javascript

I'm writing an AngularJS application which should perform image search through entire web using google custom search api. 我正在编写一个AngularJS应用程序,该应用程序应该使用Google自定义搜索API在整个网络中执行图像搜索。 I've used the query as follows: 我使用了如下查询:

'https://www.googleapis.com/customsearch/v1?key='+ googleApiKey + '&cx=014766414461901118935:knbecyxzx4u&searchType=image&startIndex=41&imgType=photo&q=' + query;

As a result I get an array which consists of 10 elements. 结果,我得到一个包含10个元素的数组。 The documentation says that it can return up to the first 100 results. 该文档说,它最多可以返回前100个结果。 How can I load all the rest of results beside those 10 which come from the query above? 除了上面查询的那10条结果之外,我如何加载所有其余结果?

Note: Besides the array of images I also get the query object which has the nextPage object which holds the metadata describing the query to use for the next page of results, but apparently I have no idea how to use it as the startIndex value is always 11 注意:除了图像数组之外,我还获得了一个查询对象,该对象具有nextPage对象,该对象保存描述要用于下一页结果的查询的元数据,但是显然我不知道如何使用它,因为startIndex值始终是11

我相信您使用&start而不是&startIndex

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM