什麼是 Bing 新聞搜尋 API?What is the Bing News Search API?

Bing 新聞搜尋 API 可讓您輕鬆地將 Bing 的認知新聞搜尋功能整合到應用程式中。The Bing News Search API makes it easy to integrate Bing's cognitive news searching capabilities into your applications. API 提供類似於 Bing 新聞的體驗,讓您可傳送搜尋查詢,並接收相關的新聞文章。The API provides a similar experience to Bing News, letting you send search queries and receive relevant news articles.

請注意,Bing 新聞搜尋 API 僅提供新聞搜尋結果。Be aware that the Bing News Search API provides news search results only. 對於其他類型的 Web 內容,請使用 Bing Web 搜尋 API影片搜尋 API影像搜尋 APIUse the Bing Web Search API, Video Search API and Image Search API for other types of web content.

Bing 新聞搜尋 API 功能Bing News Search API features

Bing 新聞搜尋 API 主要用於尋找及傳回相關的新聞文章,同時也提供多個在 Web 上智慧擷取重點新聞的功能。While the Bing News Search API primarily finds and returns relevant news articles, it provides several features for intelligent, and focused news retrieval on the web.

功能Feature 描述Description
建議和使用搜尋字詞Suggesting and using search terms 使用 Bing 自動建議 API 隨著使用者的輸入顯示建議的搜尋字詞,以改善您的搜尋體驗。Improve your search experience by using the Bing Autosuggest API to display suggested search terms as they're typed.
取得一般新聞Get general news 藉由將搜尋查詢傳送至 Bing 新聞搜尋 API 來尋找新聞,並取得相關新聞文章的清單。Find news by sending a search query to the Bing News Search API, and getting back a list of relevant news articles.
今天的熱門新聞Today's top news 取得當天所有類別中的熱門新聞事件。Get the top news stories for the day, across all categories.
各類別的新聞News by category 搜尋特定類別的新聞。Search for news in specific categories.
頭條新聞Headline news 搜尋所有類別中的熱門頭條新聞。Search for top headlines across all categories.

工作流程Workflow

Bing 新聞搜尋 API 是一種 RESTful Web 服務,因此可輕易地從任何可發出 HTTP 要求及剖析 JSON 的程式設計語言呼叫。The Bing News Search API is a RESTful web service, making it easy to call from any programming language that can make HTTP requests and parse JSON. 您可以透過 REST API 或 SDK 來使用此服務。You can use the service using either the REST API, or the SDK.

  1. 建立具備 Bing 搜尋 API 存取權的認知服務 API 帳戶。Create a Cognitive Services API account with access to the Bing Search APIs. 如果您沒有 Azure 訂用帳戶,可以建立免費帳戶If you don't have an Azure subscription, you can create an account for free.

  2. 使用有效的搜尋查詢,將要求傳送至 API。Send a request to the API, with a valid search query.

  3. 剖析傳回的 JSON 訊息以處理 API 回應。Process the API response by parsing the returned JSON message.

後續步驟Next steps

首先,嘗試使用 Bing 新聞搜尋 API 的互動式示範First, try the interactive demo for the Bing News Search API. 此示範將說明如何快速地自訂搜尋查詢,並尋找 Web 上的新聞。This demo shows how you can quickly customize a search query and find news on the web.

若要快速開始進行您的第一個 API 要求,請嘗試使用 REST API 或其中一個 SDK 的快速入門。To quickly get started with your first API request, try a quickstart for the REST API or one of the SDKs.

另請參閱See also