Events
Nov 19, 11 PM - Nov 21, 11 PM
Gain the competitive edge you need with powerful AI and Cloud solutions by attending Microsoft Ignite online.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Warning
The Bing Service is no longer available in the Windows Community Toolkit. Please use the Cognitive Services SDKs.
The Bing Service allows you to retrieve Bing results. Bing can return web and news results in your language, images, and videos for many countries/regions around the world.
Note
The current version does not require the API key and is using the rate limited public access point. The ability to specify your own key to remove the rate limits is on our backlog for a future release.
Signup for API Access using your Microsoft account. There is a free trial option for all of the Bing services (fully functional, just with API rate limits or capacity limits).
Choose the Bing Search - Free option. After selecting this and agreeing to the terms of service you will be issued two keys that are limited to 5,000 queries per month.
using Microsoft.Toolkit.Services.Bing;
var searchConfig = new BingSearchConfig
{
Country = BingCountry.UnitedStates,
Language = BingLanguage.English,
Query = SearchText.Text,
QueryType = BingQueryType.Search
};
ListView.ItemsSource = await BingService.Instance.RequestAsync(searchConfig, 50);
Imports using Microsoft.Toolkit.Services.Bing
Dim searchConfig = New BingSearchConfig With {
.Country = BingCountry.UnitedStates,
.Language = BingLanguage.English,
.Query = SearchText.Text,
.QueryType = BingQueryType.Search
}
ListView.ItemsSource = Await BingService.Instance.RequestAsync(searchConfig, 50)
BingDataProvider is a Data Provider for connecting to Bing service
Methods | Return Type | Description |
---|---|---|
GetDataAsync(BingSearchConfig, Int32, Int32, IParser) | Task<IEnumerable<TSchema>> | Wrapper around REST API for making data request |
GetDefaultParser(BingSearchConfig) | IParser<BingResult> | Returns parser implementation for specified configuration |
BingParser parse Bing results into strong type
Methods | Return Type | Description |
---|---|---|
Parse(String) | IEnumerable<BingResult> | Take string data and parse into strong data type |
BingResult is a implementation of the Bing result class.
Property | Type | Description |
---|---|---|
InternalID | string | Gets or sets identifier for strong typed record |
Link | string | Description |
Published | DateTime | Description |
Summary | string | Description |
Title | string | Gets or sets title of the search result |
BingSearchConfig configures the search query
Property | Type | Description |
---|---|---|
Country | BingCountry | Description |
Language | BingLanguage | Gets or sets search query language |
Query | string | Gets or sets search query |
QueryType | BingQueryType | Gets or sets search query type |
BingService Class for connecting to Bing
Property | Type | Description |
---|---|---|
Instance | BingService | Gets public singleton property |
Provider | BingDataProvider | Gets a reference to an instance of the underlying data provider |
Methods | Return Type | Description |
---|---|---|
GetPagedItemsAsync(Int32, Int32, CancellationToken) | Task<IEnumerable<BingResult>> | Retrieves items based on pageIndex and pageSize arguments |
RequestAsync(BingSearchConfig, Int32, Int32) | Task<List<BingResult>> | Request list data from service provider based upon a given config / query |
Bing Service Sample Page Source. You can see this in action in Windows Community Toolkit Sample App.
Device family | Universal, 10.0.15063.0 or higher |
---|---|
Namespace | Microsoft.Toolkit.Services |
NuGet package | Microsoft.Toolkit.Services |
Events
Nov 19, 11 PM - Nov 21, 11 PM
Gain the competitive edge you need with powerful AI and Cloud solutions by attending Microsoft Ignite online.
Register now