A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/azure/cognitive-services/bing-custom-search/call-endpoint-python below:

Quickstart: Call your Bing Custom Search endpoint using Python - Azure AI services

Use this quickstart to learn how to request search results from your Bing Custom Search instance. Although this application is written in Python, the Bing Custom Search API is a RESTful web service compatible with most programming languages. The source code for this sample is available on GitHub.

Prerequisites Create an Azure resource

Start using the Bing Custom Search API by creating one of the following Azure resources.

Bing Custom Search resource Multi-Service resource Create and initialize the application Send and receive a search request
  1. Construct the request URL by appending your search term to the q= query parameter, and your search instance's custom configuration ID to the customconfig= parameter. Separate the parameters with an ampersand (&). You can use the global endpoint in the following code, or use the custom subdomain endpoint displayed in the Azure portal for your resource.

    url = 'https://api.cognitive.microsoft.com/bingcustomsearch/v7.0/search?' + 'q=' + searchTerm + '&' + 'customconfig=' + customConfigId
    
  2. Send the request to your Bing Custom Search instance, and print the returned search results.

    r = requests.get(url, headers={'Ocp-Apim-Subscription-Key': subscriptionKey})
    print(r.text)
    
Next steps

Build a Custom Search web app


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4