Frequently asked questions (FAQ) about the Bing Image Search API
On October 30, 2020, the Bing Search APIs moved from Azure AI services to Bing Search Services. This documentation is provided for reference only. For updated documentation, see the Bing search API documentation. For instructions on creating new Azure resources for Bing search, see Create a Bing Search resource through the Azure Marketplace.
Find answers to commonly asked questions about concepts, code, and scenarios related to the Bing Image Search API for Azure AI services on Azure.
The following headers may occur in responses from the Bing Image Search API.
||The unique ID that Bing has assigned to the user|
||The market that was used to fulfill the request|
||The log entry on the Bing API server for this request (for support)|
It is particularly important to persist the client ID and return it with subsequent requests. When you do this, the search will use past context in ranking search results and also provide a consistent user experience.
To gain access to the headers, you can make the Bing Image Search API request through a CORS proxy. The response from such a proxy has an
It's easy to install a CORS proxy to allow our tutorial app to access the optional client headers. First, if you don't already have it, install Node.js. Then enter the following command at a command prompt.
npm install -g cors-proxy-server
Next, change the Bing Image Search API endpoint in the HTML file to:
Finally, start the CORS proxy with the following command:
Leave the command window open while you use the tutorial app; closing the window stops the proxy. In the expandable HTTP Headers section below the search results, you can now see the
X-MSEdge-ClientID header (among others) and verify that it is the same for each request.
Response headers in production
The CORS proxy approach described in the previous answer is appropriate for development, testing, and learning.
This approach also protects your API key from exposure to the public, since only the server-side script needs it. The script can use another method (such as the HTTP referrer) to make sure the request is authorized.
Is your question about a missing feature or functionality? Consider requesting or voting for it using the feedback tool.