question

KhalidAlkhatib-2348 avatar image
0 Votes"
KhalidAlkhatib-2348 asked KhalidAlkhatib-2348 answered

Advanced options for snippets retrieval in web search

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?

azure-bing-web
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YutongTie-MSFT avatar image
0 Votes"
YutongTie-MSFT answered

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://docs.microsoft.com/en-us/bing/search-apis/bing-web-search/page-results#count-values-by-api


Regards,
Yutong



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KhalidAlkhatib-2348 avatar image
0 Votes"
KhalidAlkhatib-2348 answered

Thanks, Yutong.

I am actually interested in the results for retrieving different information for a Webpage
according to https://docs.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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.