Custom Search JSON API
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
您可以運用 Custom Search JSON API 開發網站和應用程式,以程式輔助方式擷取及顯示程式化搜尋引擎的搜尋結果。透過這個 API,您可以使用符合 REST 樣式的要求,取得 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功能。額外要求的費用為每 1 千筆查詢 $5 美元,每日最多 1 萬次查詢。
Monitoring
您可以透過 Cloud Platform Console 的 API 資訊主頁取得 Custom Search JSON API 的基本監控功能。如需更進階的監控功能,請參閱 Google Cloud 作業套件 (原稱 Stackdriver)。
您可以透過 Google Cloud 作業套件建立自訂資訊主頁、設定快訊,以及以程式輔助方式存取指標資料。如要在 Google Cloud 作業套件中存取 Custom Search JSON API 使用資料,請在「Query Builder」(查詢產生器) 中選取「Resource type: Consumed API」,然後以「service = 'customsearch.googleapis.com」進行篩選。
如要瞭解 API 資訊主頁和 Google Cloud 作業套件提供的各種監控和快訊功能,請參閱監控您的 API 使用情形一文。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間: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."]]