Call your custom search

Before making your first call to the Custom Search API to get search results for your instance, you need to get a Cognitive Services subscription key. To get a key for Custom Search API, see Try Cognitive Services.

Try it out

After you've configured your custom search experience, you can test the configuration from within the Custom Search portal.

  1. Sign into Custom Search.
  2. Click a Custom Search instance from your list of instances.
  3. Click the Production tab.
  4. Under the Endpoints tab, select an endpoint (for example, Web API). Your subscription determines which endpoints are shown (see pricing for subscription options).
  5. Specify the parameter values.

    The following are the possible parameters you can set (the actual list depends on the selected endpoint). For additional information about these parameters, see Custom Search API reference.

    • Query: The search term to search for. Only available for Web, Image, Video, and Autosuggest endpoints.
    • Custom Configuration ID: The configuration ID of the selected Custom Search instance. This field is read only.
    • Market: The market where the results come from. Only available for Web, Image, Video, and Hosted UI endpoints.
    • Subscription Key: The subscription key to test with. You may select a key from the dropdown list or enter one manually.

      Clicking Additional Parameters reveals the following parameters:

    • Safe Search: A filter used to filter webpages for adult content. Available only for Web, Image, Video, and Hosted UI endpoints.

    • User Interface Language: The language used for user interface strings. For example, if you enable images and videos in Hosted UI, the Image and Video tabs use the specified language.
    • Count: The number of search results to return in the response. Available only for Web, Image, and Video endpoints.
    • Offset: The number of search results to skip before returning results. Available only for Web, Image, and Video endpoints.
  6. After you've specified all required options, click Call to view the JSON response in the right pane.

If you select the Hosted UI endpoint, you can test the search experience in the bottom pane.

Next steps