【问题标题】:Search Images in Google and get JSON response在 Google 中搜索图像并获得 JSON 响应
【发布时间】:2016-02-08 14:18:29
【问题描述】:

我正在尝试使用以下关键字搜索谷歌图片

https://www.googleapis.com/customsearch/v1?searchType=image&key=my_custom_search_key&cx=my_custom_search_engine_key&q=love

但我得到了以下 json

{

    "kind": "customsearch#search",
    "url": {

        "type": "application/json",
        "template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json"

    },
    "queries": {

        "request": [

            {
                "title": "Google Custom Search - love",
                "totalResults": "0",
                "searchTerms": "love",
                "count": ​10,
                "inputEncoding": "utf8",
                "outputEncoding": "utf8",
                "safe": "off",
                "cx": "my_custom_search_engine_key",
                "searchType": "image"
            }
        ]

    },
    "searchInformation": {
        "searchTime": ​0.054318,
        "formattedSearchTime": "0.05",
        "totalResults": "0",
        "formattedTotalResults": "0"
    }

}

哪个不给我图片的搜索结果,我需要获取图片的url和JSON中的描述?

【问题讨论】:

    标签: google-search google-image-search


    【解决方案1】:

    我喜欢你的查询,但我的密钥和 cx。但早些时候我有类似的问题,我的问题是https://cse.google.com/cse/setup/basic?cx={YOUR_CX}
    我将“图像搜索”设置为开启。点击“更新”以保存您的更改。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-13
      • 2014-12-08
      • 1970-01-01
      • 2021-09-15
      • 1970-01-01
      • 2013-05-03
      • 2015-05-22
      • 1970-01-01
      相关资源
      最近更新 更多