Advanced options for snippets retrieval in web search

Khalid Al khatib 1 Reputation point
2021-05-02T13:06:20.877+00:00

I am missing some options regarding snippets retrieval in Search API v7. For example, can I specify the min or max length of the retrieved snippets?

Bing Web Search
Bing Web Search
A Bing service that gives you enhanced search details from billions of web documents.
141 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. YutongTie-MSFT 47,596 Reputation points
    2021-05-05T03:39:43.05+00:00

    Hello,

    Sorry for the late response. I think you are looking for the Paging through search results function.

    To page through the results, use the count and offset query parameters.

    The count parameter specifies the number of results to return in the response. The maximum number of results that you may request in the response is API specific (see Count values by API). For example, the maximum count value that you may specify for the Image Search API is 150.

    The offset parameter specifies the number of results to skip. The offset is zero-based and should be less than (totalEstimatedMatches - count).

    If your user interface presents 20 news articles per page, set count to 20 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 20 (for example, 20, 40).

    The following shows an example that requests 20 news articles beginning at offset 40.

    https://<host>/api/v7.0/news/search?q=sailing&count=20&offset=40&mkt=en-us  
    

    Because each API sets a default value for count, you may specify only offset. For example, if the News Search API’s default count is 20, you only need to include the offset query parameter.

    https://<host>/api/v7.0/news/search?q=sailing&offset=40&mkt=en-us  
    

    Reference: https://learn.microsoft.com/en-us/bing/search-apis/bing-web-search/page-results#count-values-by-api

    Regards,
    Yutong

    0 comments No comments

  2. Khalid Al khatib 1 Reputation point
    2021-05-18T19:42:12.357+00:00

    Thanks, Yutong.

    I am actually interested in the results for retrieving different information for a Webpage
    according to https://learn.microsoft.com/en-us/rest/api/cognitiveservices-bingsearch/bing-web-api-v7-reference
    One of the information that we can get about a webpage is the following:
    snippet A snippet of text from the webpage that describes its contents. String

    My question if I can specify more advanced options about the snippet string. For example, I want the snippet string to have at least 100 words.

    0 comments No comments