Getting URL of images in Google Images with Google Custom Search API?

I am trying to use Google Custom Search API to get URL of images in Google Images. How do I set up my custom search site to use images.google.com as its site to search? I just tried to use the Google Images url (images.google.com) when I sat up my Custom Search, but that does not seem to work.

When I try to do a REST call this is what I get:

{
"title": "Google Custom Search - tomat",
"totalResults": "0",
"searchTerms": "tomat",
"count": 10,
"inputEncoding": "utf8",
"outputEncoding": "utf8",
"safe": "off",
"cx": "THIS IS WHERE THE CX NUMBER IS"
}

I am trying to get the image URL of the three first hits on a search query. Any ideas?


I figured it out. You have to have Image Search enabled in the control panel and have searchType=image in the query, but what I had to add was *.google.com to sites to search. When I used the wildcard at google.com it worked. :)

链接地址: http://www.djcxy.com/p/83800.html

上一篇: 从Google类似图片搜索API响应iOS获取类似图片网址

下一篇: 使用Google自定义搜索API获取Google图片中的图片网址?