Generate A Bing Search Api Key

Posted : admin On 18.04.2020

Api Key Billing Information. Ebay Search API. X Google Search Events Jobs Product Reverse Image Scholar Scholar Cite Maps Baidu Search Bing Search Yahoo! Apr 10, 2020 To get an API key: Go to the Google Cloud Platform Console. Click the project drop-down and select or create the project for which you want to add an API key. Click the menu button and select APIs & Services Credentials. On the Credentials page, click Create credentials API key. The API key created dialog displays your newly created API key.

Api
8 Feb 2018MIT
Basic code scenarios using Bing Search API endpoints to search the Web

Introduction

Bing Search API is a set of REST interfaces that find web pages, news, images, videos, entities, related searches, spelling corrections, and more in response to queries from any programming language that can generate a web request. Applications that need information from the web use the Bing Search APIs to get results in JSON format adaptable to their requirements.

Bing Search APIs include specialized endpoints for the following types:

  • Bing Web Search API - Includes Web pages and all the other types mentioned below, such as images, videos, news, related searches, spelling corrections, etc.
  • Bing News Search API - Provides news items relevant to user’s query. It also provides news for specific categories, such as health, sports, etc., and news trending at any point in time.
  • Bing Video Search API - Returns relevant videos. It also provides endpoints for similar videos and trending videos.
  • Bing Image Search API - Similar to video search API, this API has 3 endpoints: image search, similar images, and trending images.
  • Bing Entity Search API - Summary information about people, places, organizations, products, and other concepts
  • Bing Custom Search API - Supports customized search to get results from specific sources on the web: domains, subsites, or webpages.
  • Bing Autosuggest API - Provides query completion capability for partial strings.
  • Bing Spell Check API - Provides spelling and Grammar correction for short strings or large paragraphs

To experiment with the Bing Search API, you'll need an API access key, which is available at Azure: Try Cognitive Services.

Basic Programmatic Search

For simplicity, the following code sample uses the Bing Web Search API. The other endpoints use similar procedures. The Bing Web Search API is useful for finding web resources such as sites, images, videos, news, and entities for a given query. You can write code in any language that can send a GET request to the following endpoint:

Every request to the Bing Web Search API must include a header that contains the Ocp-Apim-Subscription-Key, which is your private access key. Access Keys are available for exploring these APIs.

With an access key, the basic code scenario in Java might look like this:

See the Java project source code for details of this excerpt.

Parsing results is discussed in the final section of this article.

The following code snippet shows the request code sequence in C#.

See the C# project source code for details of this excerpt.

Parsing results is discussed in the final section of this article.

Endpoints for Other Bing APIs

This section summarizes endpoints for various Bing Search APIs.

Bing Web Search API

As discussed in the previous example, the web search endpoint returns webpages, news, images, videos, entities, and related searches along with spelling corrections. The web search API endpoint follows:

Bing News Search API

The Bing News Search API supports three endpoints.

The following endpoint returns news articles for a given query:

The second endpoint, following, returns news articles for a given category such as health, business, sports, etc.

Finally, the third endpoint returns news topics that are currently trending on social networks:

Bing Video Search API

The Bing Video Search API has three endpoints. The following endpoint returns videos for a given query:

The second video endpoint, following, can be used to get videos similar to the one identified by Your_Video_Id. The “Modules” parameter is used to get the videos related to the video mentioned in the “id” parameter.

The final video endpoint returns videos that are trending at the moment. Results are separated into different categories, for example, based on noteworthy people or events.

Bing Image Search API

Bing Image Search API has three endpoints, which are similar in functionality to the Bing Video Search endpoints The following endpoint returns images relevant to a given query.

Generate A Bing Search Api Key Login

The second endpoint provides insights about a given image, such as similar images or the source of a given image. The “Modules” parameter can be used to derive various insights. The following request searches for images similar to that at a given image URL.

Bing Api Key Free

The final image endpoint returns trending images.

Bing Custom Search

Bing Custom Search returns results based on sources specified by the user. For information about defining sources, see Bing Custom Search. As with other endpoints, the query is defined by the URL parameter: ?q=” ”.

Google Search Api

Bing Autosuggest

Bing Autosuggest takes a partial query and returns suggestions for other queries based on the user’s past queries or tending queries. The results can be used to autocomplete phrases or terms.

Bing Spell Check

Bing Spell Check takes a text and checks spelling and grammar. The response returned by the following endpoint includes the original text and token suggestions that correct it.

JSON Search Results

The Bing Search API returns results as JSON objects to be parsed as text. You can use the following code to parse the JSON responses for console display:

Java sample for JSON parsing:

C# sample for JSON parsing:

Api

For more examples, see the following github repo: cognitive-services-REST-api-samples.

History

  • 20th December, 2017: First draft
  • Added link to access key page
-->

All requests to a search service need a read-only api-key that was generated specifically for your service. The api-key is the sole mechanism for authenticating access to your search service endpoint and must be included on every request. In REST solutions, the api-key is typically specified in a request header. In .NET solutions, a key is often specified as a configuration setting and then passed as Credentials (admin key) or SearchCredentials (query key) on SearchServiceClient.

Keys are created with your search service during service provisioning. You can view and obtain key values in the Azure portal.

What is an api-key

An api-key is a string composed of randomly generated numbers and letters. Through role-based permissions, you can delete or read the keys, but you can't replace a key with a user-defined password or use Active Directory as the primary authentication methodology for accessing search operations.

Two types of keys are used to access your search service: admin (read-write) and query (read-only).

KeyDescriptionLimits
AdminGrants full rights to all operations, including the ability to manage the service, create and delete indexes, indexers, and data sources.
Two admin keys, referred to as primary and secondary keys in the portal, are generated when the service is created and can be individually regenerated on demand. Having two keys allows you to roll over one key while using the second key for continued access to the service.
Admin keys are only specified in HTTP request headers. You cannot place an admin api-key in a URL.
Maximum of 2 per service
QueryGrants read-only access to indexes and documents, and are typically distributed to client applications that issue search requests.
Query keys are created on demand. You can create them manually in the portal or programmatically via the Management REST API.
Query keys can be specified in an HTTP request header for search, suggestion, or lookup operation. Alternatively, you can pass a query key as a parameter on a URL. Depending on how your client application formulates the request, it might be easier to pass the key as a query parameter:
GET /indexes/hotels/docs?search=*&$orderby=lastRenovationDate desc&api-version=2019-05-06&api-key=[query key]
50 per service

Visually, there is no distinction between an admin key or query key. Both keys are strings composed of 32 randomly generated alpha-numeric characters. If you lose track of what type of key is specified in your application, you can check the key values in the portal or use the REST API to return the value and key type.

Note

It is considered a poor security practice to pass sensitive data such as an api-key in the request URI. For this reason, Azure Cognitive Search only accepts a query key as an api-key in the query string, and you should avoid doing so unless the contents of your index should be publicly available. As a general rule, we recommend passing your api-key as a request header.

Find existing keys

You can obtain access keys in the portal or through the Management REST API. For more information, see Manage admin and query api-keys.

  1. Sign in to the Azure portal.

  2. List the search services for your subscription.

  3. Select the service and on the Overview page, click Settings >Keys to view admin and query keys.

Create query keys

Query keys are used for read-only access to documents within an index for operations targeting a documents collection. Search, filter, and suggestion queries are all operations that take a query key. Any read-only operation that returns system data or object definitions, such as an index definition or indexer status, requires an admin key.

Restricting access and operations in client apps is essential to safeguarding the search assets on your service. Always use a query key rather than an admin key for any query originating from a client app.

  1. Sign in to the Azure portal.

  2. List the search services for your subscription.

  3. Select the service and on the Overview page, click Settings >Keys.

  4. Click Manage query keys.

  5. Use the query key already generated for your service, or create up to 50 new query keys. The default query key is not named, but additional query keys can be named for manageability.

Note

A code example showing query key usage can be found in Query an Azure Cognitive Search index in C#.

Regenerate admin keys

Two admin keys are created for each service so that you can rotate a primary key, using the secondary key for business continuity.

  1. In the Settings >Keys page, copy the secondary key.
  2. For all applications, update the api-key settings to use the secondary key.
  3. Regenerate the primary key.
  4. Update all applications to use the new primary key.

If you inadvertently regenerate both keys at the same time, all client requests using those keys will fail with HTTP 403 Forbidden. However, content is not deleted and you are not locked out permanently.

You can still access the service through the portal or the management layer (REST API, PowerShell, or Azure Resource Manager). Management functions are operative through a subscription ID not a service api-key, and thus still available even if your api-keys are not.

After you create new keys via portal or management layer, access is restored to your content (indexes, indexers, data sources, synonym maps) once you have the new keys and provide those keys on requests.

Secure api-keys

Key security is ensured by restricting access via the portal or Resource Manager interfaces (PowerShell or command-line interface). As noted, subscription administrators can view and regenerate all api-keys. As a precaution, review role assignments to understand who has access to the admin keys.

  • In the service dashboard, click Access control (IAM) and then the Role assignments tab to view role assignments for your service.

Members of the following roles can view and regenerate keys: Owner, Contributor, Search Service Contributors

Note

Jun 04, 2017  Buy a The7WG hat here - NEW STREAMING CHANNEL: Donate: Twitter: https://twitter.com/Th. CSR Racing 2 Online Generator. The form below you requires your username. This is required because our key tool has to know who to send hacked Silver Keys, Gold Keys and other goodies to. Murugame info csr2.

For identity-based access over search results, you can create security filters to trim results by identity, removing documents for which the requestor should not have access. For more information, see Security filters and Secure with Active Directory.

See also