bing-search-sdk-for-net/samples/BingSearchSamples/BingCustomWebSearch
Joe Perez aa0a0ddbe7
Update README.md
2021-04-05 16:50:37 -07:00
..
.gitignore adding seperate samples 2020-12-06 18:28:38 +02:00
CustomSearchSamples.cs fixing sample project name 2021-02-15 16:05:33 +02:00
ExampleAbstraction.cs fixing sample project name 2021-02-15 16:05:33 +02:00
ExampleAttribute.cs fixing sample project name 2021-02-15 16:05:33 +02:00
Microsoft.Bing.CustomWebSearch.Samples.csproj adding reference to package 2021-03-02 11:45:52 +02:00
Microsoft.Bing.CustomWebSearch.Samples.sln adding reference to package 2021-03-02 11:45:52 +02:00
Program.cs fixing sample project name 2021-02-15 16:05:33 +02:00
README.md Update README.md 2021-04-05 16:50:37 -07:00
SampleCollectionAttribute.cs fixing sample project name 2021-02-15 16:05:33 +02:00

README.md

The Bing Custom Search SDK sample

This sample shows you how to get up and running using the Bing Custom Search Nuget package. This example covers a few use cases and expresses best practices for interacting with the data from this API. For more information on the Bing Custom Search API v7, go to: https://www.customsearch.ai/. Complete reference documentation including descriptions of parameters, their values, and supported markets is available here.

If you want to amend samples to suit your needs, the most important file is CustomSearchSamples.cs. See how you can access this file in the Quickstart section below.

Features

This sample references the Bing Custom Search SDK, which is a stand-alone package for the v7 version of this API. An all-in-one package including all the Bing Search APIs will be available in the future.

This example provides sample use cases of the Bing Custom Search v7 using the Bing Custom Search Nuget Package at https://www.nuget.org/packages/Microsoft.Bing.Search.CustomWebSearch/.

Getting started

Prerequisites

  • Visual Studio 2017. If required, you can download the free community version.
  • A Bing API key is required to authenticate SDK calls. You can sign up here for the free trial key. This trial key is good for 30 days with 3 calls per second. Or, for production scenarios, you can buy an access key. When buying access key, consider which tier is appropriate for you.
  • .NET Core SDK (with the ability to run .netcore 1.1 apps). You can get Core, Framework, and Runtime from here: https://www.microsoft.com/net/download/.

Quickstart

To get the Bing Custom Web Search Search sample running locally, follow these steps:

  1. Run git clone https://github.com/microsoft/bing-search-sdk-for-net.git.
  2. From Visual Studio 2017, open bing-search-sdk-for-net\samples\BingSearchSamples\BingCustomWebSearch\Microsoft.Bing.CustomWebSearch.Samples.sln.
  3. From Tools > Nuget Package Manager > Package Manager Console, run npm install https://www.nuget.org/packages/Microsoft.Bing.Search.CustomWebSearch/. Or, go to Project > Manage Nuget Packages and search for Microsoft.Bing.CustomWebSearch under the Browse tab, and click Install
  4. From the top menu of Visual Studio, click Microsoft.Bing.CustomWebSearch.Samples. This runs examples from the BingCustomSearch\CustomSearchSamples.cs file.

Note:

Change TargetFramework in Microsoft.Bing.CustomWebSearch.Samples.csproj to netcoreapp1.1 if you have .NET Framework version as 2.1.2.

For older versions:

Current

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

Revision

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>

Resources