chatgpt-api/docs/bing-web-search.md

3.8 KiB

Bing Web Search Agentic Service

Intro

Bing Web Search provides the ability to comb billions of webpages, images, videos, and news with a single API call. It provides a set of search results that match the query parameters specified in the API request.

Pre-requisites

Ensure the following environment variable is set:

  • BING_API_KEY - API key for the Bing Web Search service

Otherwise, you can pass it in as an argument to the BingWebSearchClient constructor.

How to Retrieve API Key

  1. Open https://www.microsoft.com/en-us/bing/apis/bing-web-search-api in your browser and click the "Try Now" button to create a Bing Web Search resource in your Azure account.

  2. On the opened "Create a Bing search resource" screen, enter your Subscription name and Resource group name. If you don't have a resource group, you can create one by clicking "Create new" and entering a name for the resource group. Enter a name for the search resource and select a region.

  3. Under the "Select a pricing tier" dropdown, select F1 (3 Calls per second, 1k Calls per month) for the free tier. See Bing Web Search pricing for more information about the available pricing tiers.

  4. After reviewing the terms and conditions, tick the checkbox and click "Review + create". Review the information on the next screen and click "Create" to create the resource.

  5. Once the resource has been deployed, navigate to it and click on the "Keys and Endpoint" link in the left sidebar:

  6. Click the "Copy to clipboard" button next to the "Key 1" value to copy the API key to your clipboard (or click "Show" to reveal the key and copy it manually). The other key is a backup key that can be used if the first key is revoked or regenerated.