BingNews Interface

public interface BingNews

An instance of this class provides access to all the operations defined in BingNews.

Method Summary

Modifier and Type Method and Description
BingNewsCategoryDefinitionStages.WithExecute category()

The News Category API lets lets you search on Bing and get back a list of top news articles by category. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

NewsModel category(CategoryOptionalParameter categoryOptionalParameter)

The News Category API lets lets you search on Bing and get back a list of top news articles by category. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Observable<NewsModel> categoryAsync(CategoryOptionalParameter categoryOptionalParameter)

The News Category API lets lets you search on Bing and get back a list of top news articles by category. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

BingNewsSearchDefinitionStages.WithQuery search()

The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

NewsModel search(String query, SearchOptionalParameter searchOptionalParameter)

The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Observable<NewsModel> searchAsync(String query, SearchOptionalParameter searchOptionalParameter)

The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

BingNewsTrendingDefinitionStages.WithExecute trending()

The News Trending Topics API lets lets you search on Bing and get back a list of trending news topics that are currently trending on Bing. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

TrendingTopics trending(TrendingOptionalParameter trendingOptionalParameter)

The News Trending Topics API lets lets you search on Bing and get back a list of trending news topics that are currently trending on Bing. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Observable<TrendingTopics> trendingAsync(TrendingOptionalParameter trendingOptionalParameter)

The News Trending Topics API lets lets you search on Bing and get back a list of trending news topics that are currently trending on Bing. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Method Details

category

public BingNewsCategoryDefinitionStages.WithExecute category()

The News Category API lets lets you search on Bing and get back a list of top news articles by category. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Returns:

the first stage of the category call

category

public NewsModel category(CategoryOptionalParameter categoryOptionalParameter)

The News Category API lets lets you search on Bing and get back a list of top news articles by category. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Parameters:

categoryOptionalParameter - the object representing the optional parameters to be set before calling this API

Returns:

the NewsModel object if successful.

Throws:

IllegalArgumentException - thrown if parameters fail the validation
ErrorResponseException - thrown if the request is rejected by server
RuntimeException - all other wrapped checked exceptions if the request fails to be sent

categoryAsync

public Observable categoryAsync(CategoryOptionalParameter categoryOptionalParameter)

The News Category API lets lets you search on Bing and get back a list of top news articles by category. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Parameters:

categoryOptionalParameter - the object representing the optional parameters to be set before calling this API

Returns:

the observable to the NewsModel object

Throws:

IllegalArgumentException - thrown if parameters fail the validation

search

public BingNewsSearchDefinitionStages.WithQuery search()

The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Returns:

the first stage of the search call

search

public NewsModel search(String query, SearchOptionalParameter searchOptionalParameter)

The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Parameters:

query - The user's search query string. The query string cannot be empty. The query string may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to limit news to a specific domain, use the [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. Use this parameter only with the News Search API. Do not specify this parameter when calling the Trending Topics API or News Category API.
searchOptionalParameter - the object representing the optional parameters to be set before calling this API

Returns:

the NewsModel object if successful.

Throws:

IllegalArgumentException - thrown if parameters fail the validation
ErrorResponseException - thrown if the request is rejected by server
RuntimeException - all other wrapped checked exceptions if the request fails to be sent

searchAsync

public Observable searchAsync(String query, SearchOptionalParameter searchOptionalParameter)

The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Parameters:

query - The user's search query string. The query string cannot be empty. The query string may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to limit news to a specific domain, use the [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. Use this parameter only with the News Search API. Do not specify this parameter when calling the Trending Topics API or News Category API.
searchOptionalParameter - the object representing the optional parameters to be set before calling this API

Returns:

the observable to the NewsModel object

Throws:

IllegalArgumentException - thrown if parameters fail the validation

trending

public BingNewsTrendingDefinitionStages.WithExecute trending()

The News Trending Topics API lets lets you search on Bing and get back a list of trending news topics that are currently trending on Bing. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Returns:

the first stage of the trending call

trending

public TrendingTopics trending(TrendingOptionalParameter trendingOptionalParameter)

The News Trending Topics API lets lets you search on Bing and get back a list of trending news topics that are currently trending on Bing. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Parameters:

trendingOptionalParameter - the object representing the optional parameters to be set before calling this API

Returns:

the TrendingTopics object if successful.

Throws:

IllegalArgumentException - thrown if parameters fail the validation
ErrorResponseException - thrown if the request is rejected by server
RuntimeException - all other wrapped checked exceptions if the request fails to be sent

trendingAsync

public Observable trendingAsync(TrendingOptionalParameter trendingOptionalParameter)

The News Trending Topics API lets lets you search on Bing and get back a list of trending news topics that are currently trending on Bing. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).

Parameters:

trendingOptionalParameter - the object representing the optional parameters to be set before calling this API

Returns:

the observable to the TrendingTopics object

Throws:

IllegalArgumentException - thrown if parameters fail the validation

Applies to