How do I use the New Bing Search API on a webpage?

120 views Asked by At

Microsoft changed its search API. What is the updated JavaScript Code for the New Bing Custom Search API to go on a webpage?

I have the subscription setup in Azure, but I cannot find the JavaScript code I can use on my simple web page anywhere. This is the current complete HTML and JavaScript code that is no longer working:

<h2>Search Page</h2>

<script type="text/javascript" 
        id="bcs_js_snippet" 
        src="https://ui.customsearch.ai/api/ux/rendering-js?customConfig=23578e33-c237-4783-80a1-0d4cbe41b39d&amp;market=en-US&amp;version=latest&amp;q="
></script>
<div class="bcs-container-searchbox">
  <input id="bcs-searchbox" 
         aria-label="Search input" 
         class="bcs-searchbox" 
         placeholder="Enter search term"
  >
  <button type="button" 
          class="bcs-searchbox-submit" 
          aria-label="Search" 
          onclick="bcsSearchBoxSubmit()"
  ></button>
  <div id="bcsSuggestionsContainer" 
       role="listbox" 
       aria-label="Suggestions"
  ></div>
</div>
0

There are 0 answers