Custom Search JSON API
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助 Custom Search JSON API,您可以开发网站和应用,以程序化地检索和显示来自可编程搜索引擎的搜索结果。借助此 API,您可以使用 RESTful 请求获取 JSON 格式的网页搜索或图片搜索结果。
Custom Search JSON API 可以返回 JSON 数据格式的结果。
Custom Search JSON API 使用 OpenSearch 1.1 规范。
前提条件
搜索引擎 ID
在使用 Custom Search JSON API 之前,您需要先创建并配置可编程搜索引擎。如果您尚未创建可编程搜索引擎,可以先访问可编程搜索引擎控制台。
按照教程中的说明详细了解不同的配置选项。
创建可编程搜索引擎后,请访问帮助中心,了解如何查找您的搜索引擎 ID。
API 密钥
Custom Search JSON API 需要使用 API 密钥。
获取密钥
价格
Custom Search JSON API 每天免费提供 100 次搜索查询。
如果您需要更多实例,可以在 API 控制台中注册billing服务。额外请求的费用为每 1000 次查询 $5,每天最多 1 万次查询。
Monitoring
您可以通过 Cloud Platform 控制台的 API 信息中心对 Custom Search JSON API 进行基本监控。如需更高级的监控功能,您可以使用 Google Cloud 的运维套件(原 Stackdriver)。
借助 Google Cloud Operations,您可以自定义信息中心、设置提醒并以编程方式访问指标数据。如需在 Google Cloud Operations 中访问 Custom Search JSON API 使用情况数据,请选择“Resource type: Consumed API”,然后在查询构建器中按“service = 'customsearch.googleapis.com'”进行过滤。
请参阅监控 API 用量,了解 API 信息中心和 Google Cloud 运维套件提供的不同监控和提醒功能的相关讨论。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThe Custom Search JSON API allows you to programmatically retrieve and display web and image search results from your Programmable Search Engine using RESTful requests.\u003c/p\u003e\n"],["\u003cp\u003eResults are delivered in JSON format and the API adheres to the OpenSearch 1.1 Specification.\u003c/p\u003e\n"],["\u003cp\u003eTo use the API, you need a Search engine ID (obtained by creating a Programmable Search Engine) and an API key.\u003c/p\u003e\n"],["\u003cp\u003eThe API offers 100 free daily search queries, with additional usage billed at $5 per 1000 queries (up to 10,000 per day).\u003c/p\u003e\n"],["\u003cp\u003eMonitor API usage and performance through the Cloud Platform Console's API Dashboard or Google Cloud's Operations suite for more advanced insights.\u003c/p\u003e\n"]]],[],null,["# Custom Search JSON API\n\nThe Custom Search JSON API lets you develop websites and applications to retrieve\nand display search results from Programmable Search Engine programmatically.\nWith this API, you can use RESTful requests to get either **web search** or\n**image search** results in JSON format.\n\nData format\n-----------\n\nCustom Search JSON API can return results in [JSON](/custom-search/docs/glossary#json) data format.\n\nRelated documents\n-----------------\n\nThe Custom Search JSON API uses the [OpenSearch 1.1 Specification](https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md).\n\nPrerequisites\n-------------\n\n### Search engine ID\n\nBefore using the Custom Search JSON API you will first need to create and configure your Programmable Search Engine. If you have not already created a Programmable Search Engine, you can start by visiting the [Programmable Search Engine control panel](https://programmablesearchengine.google.com/controlpanel/all).\n\nFollow the [tutorial](/custom-search/docs/tutorial/creatingcse) to learn more about different configuration options.\n\nAfter you have created a Programmable Search Engine, visit the [help center](https://support.google.com/programmable-search/answer/2649143) to learn how to locate your Search engine ID.\n\n### API key\n\nCustom Search JSON API requires the use of an API key.\nGet a Key\n\nPricing\n-------\n\nCustom Search JSON API provides 100 search queries per day for free.\nIf you need more, you may sign up for [billing](https://cloud.google.com/billing/docs/how-to/manage-billing-account)\nin the API Console. Additional requests cost $5 per 1000\nqueries, up to 10k queries per day.\n\nMonitoring\n----------\n\nBasic monitoring for the Custom Search JSON API is available through [Cloud Platform Console's API Dashboard](https://console.cloud.google.com/apis/dashboard). For more advanced monitoring [Google Cloud's Operations suite](https://cloud.google.com/products/operations) (formerly Stackdriver) is available.\n\nWith Google Cloud Operations you can create [custom dashboards](https://cloud.google.com/monitoring/charts), [set up\nalerts](https://cloud.google.com/monitoring/alerts), and\n[access metrics data programmatically](https://cloud.google.com/monitoring/api/v3). To access Custom Search JSON API usage data in Google Cloud Operations, select \"Resource type: Consumed API\" and filter on \"service = 'customsearch.googleapis.com'\" in the Query Builder.\n\nSee [Monitoring Your API Usage](https://cloud.google.com/apis/docs/monitoring) for a discussion of the different monitoring and alerting capabilities provided by the API Dashboard and the Google Cloud Operations suite."]]