您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

什么是必应新闻搜索 API?What is the Bing News Search API?

使用必应新闻搜索 API,可以轻松将必应的认知新闻搜索功能集成到应用程序中。The Bing News Search API makes it easy to integrate Bing's cognitive news searching capabilities into your applications. 此 API 提供的体验与必应新闻类似,可以让你发送搜索查询并接受相关的新闻文章。The API provides a similar experience to Bing News, letting you send search queries and receive relevant news articles.

请注意,必应新闻搜索 API 仅提供新闻搜索结果。Be aware that the Bing News Search API provides news search results only. 对于其他类型的 Web 内容,请使用必应 Web 搜索 API视频搜索 API图像搜索 APIUse the Bing Web Search API, Video Search API and Image Search API for other types of web content.

必应新闻搜索 API 功能Bing News Search API features

虽然必应新闻搜索 API 主要用于查找并返回相关的新闻文章,但它还提供了一些在网络上进行智能化、集中化新闻检索的功能。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.

FeatureFeature 说明Description
建议和使用搜索词Suggesting and using search terms 在用户键入时通过必应自动建议 API 显示建议的搜索词改善搜索体验。Improve your search experience by using the Bing Autosuggest API to display suggested search terms as they're typed.
获取一般新闻Get general news 查找新闻时,可以向必应新闻搜索 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

必应新闻搜索 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. 创建可以访问必应搜索 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

首先,请尝试必应新闻搜索 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