如何在目标c中使用Google自定义搜索进行图像搜索

如何在目标c中使用Google自定义搜索进行图像搜索

问题描述:

任何人都可以告诉我如何在我的iphone应用程序中使用谷歌自定义搜索来搜索图像。我试了但是它要求'cse'或'cx'参数。请帮忙。

can any one please tell me how I can use google custom search in my iphone application to search images only. I tried it but it asks for 'cse' or 'cx' parameter. Please help.

Google Custom Search API 可让您开发网站和程序以检索和显示以编程方式从Google自定义搜索中搜索结果。

The Google Custom Search API lets you develop websites and programs to retrieve and display search results from Google Custom Search programmatically.

使用此API,您可以使用RESTful请求获取网络搜索图片搜索会产生JSON或Atom格式。

With this API, you can use RESTful requests to get either web search or image search results in JSON or Atom format.

请参阅可用文档此处

请参阅这个也是

注意:

cx:自定义搜索引擎的标识符。

cx: The identifier of the custom search engine.

访问 Google自定义搜索页 ,以便为测试目的创建自定义搜索引擎。选择要包含在搜索中的站点并配置其他选项。

Visit the Google Custom Search page to create a custom search engine for testing purposes. Select the sites that you would like to include in the search and configure the other options.

点击控制面板,然后记下搜索引擎唯一ID 。这是API使用的 cx参数

Click on "control panel" and note your Search engine unique ID. This is the cx parameter used by the API.

请参阅完整文档

示例:

GET https://www.googleapis.com/customsearch/v1?key=INSERT-YOUR-KEY&cx=017576662512468239146:omuauf_lfve&q=lectures

<script src="https://www.googleapis.com/customsearch/v1?key=YOUR-KEY&cx=017576662512468239146:omuauf_lfve&q=cars&callback=hndlr">