概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
什么是可编程搜索引擎?
借助可编程搜索引擎,您可以为自己的网站、博客或网站集合创建搜索引擎。您可将搜索引擎配置为同时搜索网页和图片。您可以微调排名,自定义搜索结果的外观和风格,并邀请您的朋友或可信用户帮助您构建可编程搜索引擎。您甚至可以使用 Google AdSense 帐号通过搜索引擎赚钱。
可编程搜索引擎有两个主要用例:您可以创建一个只搜索一个网站内容的搜索引擎(网站搜索),也可以创建一个关注多个网站中特定主题的搜索引擎。您可以根据自己在某个主题方面的专业知识来告诉可编程搜索引擎要搜索哪些网站、确定哪些网站需要优先搜索或忽略哪些网站。由于您非常了解用户,因此您可以根据用户的兴趣定制搜索引擎。
借助可编程搜索引擎,您可以:
- 创建可在指定的网站或网页集合中进行搜索的可编程搜索引擎
- 为您的网站启用图片搜索
- 自定义搜索结果的外观和风格,包括添加“即输即搜”自动补全功能
- 在搜索结果中添加促销信息
- 利用您网站上的结构化数据来自定义搜索结果
- 使用您的 Google AdSense 帐号创建一个用于创收的搜索引擎广告单元,这样每当用户点击您的搜索结果页上的广告时,您就可以获得收入。
可编程搜索引擎服务摘要
可编程搜索引擎有四种产品可供使用。此图表可帮助您选择最适合您网站的推介内容。
提供的服务 |
标准搜索元素 |
公益组织搜索元素 |
付费搜索元素 |
Custom Search JSON API |
费用 |
免费 |
免费 |
每千次查询 $5 |
每千次查询 $5 |
Ads |
是 |
否 |
否 |
否 |
Google 品牌标识 |
选填 |
是 |
选填 |
否 |
每日查询限额 |
没有每日上限 |
没有每日上限 |
没有每日上限 |
每天 10,000 次查询 |
实现 |
客户端 JavaScript |
客户端 JavaScript |
客户端 JavaScript |
客户端或服务器端 JSON API |
可用性 |
所有人 |
仅限公益组织 |
所有人 |
所有人 |
入门指南 |
了解详情
|
了解详情 |
了解详情 |
了解详情
|
可用的 API
创建可编程搜索引擎后,您可以使用由 Google 托管的默认页面向用户显示结果,也可以直接将搜索功能嵌入到您的网站中。如果开发者希望在创建搜索引擎和自定义搜索结果的外观方面拥有更大的控制权,可以参考以下资源:
使用入门
若要开始使用可编程搜索引擎,最简单的方法是使用控制面板创建一个基本搜索引擎。然后,您可以下载需要修改的关键 XML 文件,以便以编程方式自定义您的搜索引擎。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eProgrammable Search Engine allows you to build custom search engines for your website, blog, or a collection of websites, enabling searches across web pages and images.\u003c/p\u003e\n"],["\u003cp\u003eYou can refine search rankings, personalize the appearance of search results, and potentially monetize your search engine using Google AdSense.\u003c/p\u003e\n"],["\u003cp\u003eProgrammable Search Engine offers four distinct offerings: Standard, Non-profit, Paid, and Custom Search JSON API, each with varying features and costs.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage APIs like the Programmable Search Element Control API and the Custom Search JSON API for advanced customization and integration.\u003c/p\u003e\n"],["\u003cp\u003eCreating a basic search engine through the Control Panel is the easiest way to begin using Programmable Search Engine.\u003c/p\u003e\n"]]],[],null,["# Overview\n\nWhat Is Programmable Search Engine?\n-----------------------------------\n\nProgrammable Search Engine lets you create a search engine for your website,\nyour blog, or a collection of websites. You can configure your search engine to\nsearch both web pages and images. You can fine-tune the ranking, customize the\nlook and feel of the search results, and invite your friends or trusted users to\nhelp you build your Programmable Search Engine. You can even make money from\nyour search engine by using your [Google AdSense account](https://www.google.com/adsense/login?sourceid=aso&subid=ww-en-et-aso_api3&medium=link).\n\nThere are two main use cases for Programmable Search Engine - you can create a\nsearch engine that searches only the contents of one website (site search), or\nyou can create one that focuses on a particular topic from multiple sites. You\ncan use your expertise about a subject to tell Programmable Search Engine which\nwebsites to search, prioritize, or ignore. Because you know your users well, you\ncan tailor the search engine to their interests.\n\nWith Programmable Search Engine, you can:\n\n- Create Programmable Search Engines that search across a specified collection of sites or pages\n- Enable image search for your site\n- Customize the look and feel of search results, including adding search-as-you-type autocompletions\n- Add promotions to your search results\n- Leverage structured data on your site to customize search results\n- Create a monetized search engine ad unit with your Google AdSense account, so you make money whenever users click ads on your search results pages.\n\nSummary of Programmable Search Engine Offerings\n-----------------------------------------------\n\nProgrammable Search Engine has four offerings available for use. Use this chart\nto help you select which offering is best for your site.\n\n|-------------------|-------------------------------------------|------------------------------------------------------------------------------|-----------------------------------------------------------------------------|------------------------------------------|\n| Offering | Standard Search Element | Non-profit Search Element | Paid Search Element | Custom Search JSON API |\n| Cost | Free | Free | $5 per thousand queries | $5 per thousand queries |\n| Ads | Yes | No | No | No |\n| Google Branding | Optional | Yes | Optional | No |\n| Daily Query Limit | No Daily Limit | No Daily Limit | No Daily Limit | 10,000 queries per day |\n| Implementation | Client side javascript | Client side javascript | Client side javascript | Client side or server side JSON API |\n| Availability | Everyone | Non-profits only | Everyone | Everyone |\n| Getting Started | [Learn More](/custom-search/docs/element) | [Learn More](https://support.google.com/programmable-search/answer/12423873) | [Learn More](https://developers.google.com/custom-search/docs/paid_element) | [Learn More](/custom-search/v1/overview) |\n\nAvailable APIs\n--------------\n\nAfter creating a Programmable Search Engine, you can use a default page hosted\nby Google to show your results to the user, or you can embed search\nfunctionality directly in your website. The following resources are available to\ndevelopers who want more control over creating search engines and customizing\nthe appearance of search results:\n\n- The [Programmable Search Element Control API](/custom-search/docs/element)\n\n lets you embed the Programmable Search Element in your web pages and other\n web applications using JavaScript.\n- The [Custom Search JSON API](/custom-search/v1/overview) lets you\n develop websites and programs to retrieve and display search results from\n Programmable Search Engine programmatically. With this API, you can use\n RESTful requests to get search results in JSON format.\n\nGetting started\n---------------\n\nThe easiest way to get started with Programmable Search Engine is to create a\nbasic search engine using the [Control Panel](https://programmablesearchengine.google.com/controlpanel/all). You can\nthen download the key XML files you need to modify to customize your search\nengine programmatically."]]