搜索页码-Google自定义搜索API

时间:2018-06-20 15:34:42

标签: javascript node.js electron google-custom-search

我正在使用Google自定义搜索API来获取一些图像。一切工作正常,但我所有的查询都得到相同的结果。我可以使用某种类型的搜索起始页码或其他方式为同一关键字获取不同的图片。 (例如“飞机”)。

这是我的代码,

async function imgRequest(options, arrayImg) {
    const res = await customsearch.cse.list({
        cx: "-----",
        q: "plane",
        auth: "-----",
        searchType: "image"
    });
    console.log(res.data.items[0].link);
    return res.data;
}

先谢谢了。随时问任何问题。

1 个答案:

答案 0 :(得分:0)

有一个“开始”参数:“要返回的第一个结果的索引”

请参阅 https://developers.google.com/custom-search/json-api/v1/reference/cse/list

相关问题