簡體   English   中英

搜索頁碼-Google自定義搜索API

[英]search page number - Google custom search API

我正在使用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;
}

提前致謝。 隨意問任何問題。

有一個“開始”參數:“要返回的第一個結果的索引”

請參閱https://developers.google.com/custom-search/json-api/v1/reference/cse/list

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM